[FFmpeg-devel] [PATCH] Stream parsing
Michael Niedermayer
michaelni
Sun Oct 3 21:36:56 CEST 2010
On Sun, Oct 03, 2010 at 09:18:19PM +0200, Benjamin Larsson wrote:
> On 10/03/2010 08:40 PM, Justin Ruggles wrote:
> > Benjamin Larsson wrote:
> >
> >> $topic, previously discussed in [RFC] Stream parsing
> >>
> >> MvH
> >> Benjamin Larsson
> >>
> >
> >> +/**
> >> + * Codec should fill in channel configuration and samplerate instead of container
> >> + */
> >> +#define CODEC_CAP_CHANNEL_CONF 0x0400
> > [...]
> >> @@ -2191,9 +2192,17 @@
> >> }
> >> }
> >> assert(!st->codec->codec);
> >> + codec = avcodec_find_decoder(st->codec->codec_id);
> >> +
> >> + /* Force decoding of at least one frame of codec data
> >> + * this makes sure the codec initializes the channel configuration
> >> + * and does not trust the values from the container.
> >> + */
> >> + if (codec && codec->capabilities & CODEC_CAP_CHANNEL_CONF)
> >> + st->codec->channels = 0;
> >
> > Your documentation says channel configuration and samplerate. Why is
> > sample_rate not also set to 0 here?
> >
> > -Justin
>
>
> As long as
>
> if (!has_codec_parameters(st->codec) ||
> !has_decode_delay_been_guessed(st))
> try_decode_frame(st, pkt);
>
> will happen the codec will override whatever is set in the codec
> context. Just setting channels to 0 will make sure that happens.
and it feels correcter to just set channels to 0 because its more likely
that the codec knows at least the channels count
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101003/aa5f53a6/attachment.pgp>
More information about the ffmpeg-devel
mailing list