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

Michael Niedermayer michaelni
Tue Jul 27 15:59:27 CEST 2010


On Tue, Jul 27, 2010 at 07:59:13AM +0300, Anssi Hannula wrote:
> Michael Niedermayer kirjoitti perjantai, 23. hein?kuuta 2010 16:32:50:
> > On Fri, Jul 23, 2010 at 08:00:21AM +0300, Anssi Hannula wrote:
> > [...]
> > >  }
> > > 
> > > +#if CONFIG_SPDIF_MUXER
> > > 
> > >  static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt)
> [...]
> > 
> > if it compiles without the ifdefs then please remove them
> > its the compilers job to remove unused static functions
> > (might needs a av_unused))
> 
> It compiles, but warnings are emitted about unused functions when one of spdif 
> demuxer or muxer is disabled (and I assumed you didn't want me to add 
> av_unused to every function).

you also could just put the demuxer in a seperate file if this is possible



> 
> Attached is a new version with unnecessary ifdefs removed and a better probe 
> function.
> 
> -- 
> Anssi Hannula

[...]
> +static int spdif_probe(AVProbeData *p)
> +{
> +    const uint8_t *buf = p->buf;
> +    /* probe for 64 bytes to find initial sync word */
> +    const uint8_t *probe_end = p->buf + FFMIN(64, p->buf_size - 1);

this looks like it wont work if the stream is randomly cut
it would be nice if that worked too though


[...]
> +    if (sync_codes == consecutive_codes + 1 &&
> +        !memcmp(p->buf + 8, "WAVE", 4) && !memcmp(p->buf, "RIFF", 4))
> +        /* all sync codes (except first one as it was only after WAV headers)
> +           were consecutive, but the buffer was too small;
> +           also, this looks like a WAV file, so we need to delay wav demuxer
> +           from grabbing this file until we get a big enough buffer to see if
> +           there are more consecutive codes (we want to be selected for
> +           (ac3-in-)spdif-in-wav as chained demuxers are not yet supported),
> +           therefore return the same score as wav demuxer to make it a tie */
> +        return AVPROBE_SCORE_MAX - 1;

or make the wav demuxer only return a low score for small probe sizes
above would for example behave oddly if the wav demuxer is disabled


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100727/2dd83327/attachment.pgp>



More information about the ffmpeg-devel mailing list