[FFmpeg-devel] [PATCH] lavc/ac3: set channel_layout when downmixing.

Nicolas George nicolas.george at normalesup.org
Sat Aug 10 12:50:05 CEST 2013


Le decadi 20 thermidor, an CCXXI, Michael Niedermayer a écrit :
> > @@ -90,6 +90,7 @@ get_next:
> >                  (avctx->codec_id == AV_CODEC_ID_AC3 ||
> >                   avctx->codec_id == AV_CODEC_ID_EAC3)))) {
> >              avctx->channels = avctx->request_channels;
> > +            avctx->channel_layout = av_get_default_channel_layout(avctx->channels);
> >          } else {
> >              avctx->channels = s->channels;
> >              avctx->channel_layout = s->channel_layout;
> 
> iam not sure if setting this from the parser is completely safe
> the parser could even be used with a binary decoder which might behave
> differently

I do not understand in what case it can be unsafe. As you can see, the
parser sets avctx->channels in both branches (request_channels set or not),
and it sets avctx->channel_layout in one of the branches. If three corners
of the square are safe, how could the fourth not be?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130810/0a191f8f/attachment.asc>


More information about the ffmpeg-devel mailing list