[FFmpeg-devel] [PATCH] S/PDIF demuxer (was:[PATCH] Detect DTS in wav (issue70) + about ac3-in-wav)

Anssi Hannula anssi.hannula
Fri Jul 23 10:27:25 CEST 2010


Carl Eugen Hoyos kirjoitti perjantai, 23. hein?kuuta 2010 10:57:06:
> Anssi Hannula <anssi.hannula <at> iki.fi> writes:
> > Ok, attached is an S/PDIF demuxer. Both ac3-in-spdif-in-wav files and
> > normal wav files confirmed to work correctly after the patch.
> > 
> > +    if (state == (AV_BSWAP16C(SYNCWORD1) << 16 |
> > AV_BSWAP16C(SYNCWORD2))) {
> > +        if (buf == p->buf + 7)
> > +            return AVPROBE_SCORE_MAX; /* sync word at the very beginning
> > */
> 
> Please also test if data_type < 0x37

Ok, adding (data_type & 0xff) < 0x37 (AC3 bistream mode is apparently in the 
upper bits).

> and use pkt_size to find the next
> syncwords.

Note that pkt_size can't be directly used to find the next syncword, but 
indeed we can always skip pkt_size bytes and then loop through the padding 
only. Will add that.
Actually, data_type *can* be used to find the next syncword (except for AAC 
for which we need a value from the AAC headers), so I'll probably use those 
then..

Or did you mean that 4 byte sync code + data_type check is not enough, even if 
it is in the beginning of file?
I did that because some other probes return AVPROBE_SCORE_MAX for 4-byte 
codes, but certainly I can check more if you think that is necessary.

-- 
Anssi Hannula



More information about the ffmpeg-devel mailing list