[Ffmpeg-devel] [PATCH] DVR-MS probe audio format - was DVR-MS bug (MP2 decoding)
John Donaghy
johnfdonaghy
Thu Mar 15 21:01:10 CET 2007
> theres a ac3_probe in libaformar/raw.c, if it works with what is stored in
asf
> that i dunno
>
I got a prototype of the proposed approach to work but I had to modify the
ac3_probe function to read up to the first 'sync word'. Is that going to be
acceptable?
new version...
int ac3_probe(AVProbeData *p)
{
int score=0;
int i;
// find first sync word
for (i=0; i<p->buf_size-6; i++) {
if((p->buf[i] == 0x0B) && (p->buf[i+1] == 0x77)) {
break;
}
}
if(p->buf_size-i < 6)
return 0;
if((p->buf[i] == 0x0B) && (p->buf[i+1] == 0x77) && // sync word
((p->buf[i+4] >> 6) != 3) && // fscod
((p->buf[i+5] >> 3) <= 16)) { // bsid
score = AVPROBE_SCORE_MAX / 2 + 10;
}
return score;
}
More information about the ffmpeg-devel
mailing list