[FFmpeg-cvslog] If AVCodecContext.channels is 0 and AVCodecContext.channel_layout is
Justin Ruggles
git at videolan.org
Thu Apr 28 04:28:31 CEST 2011
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Apr 19 19:03:47 2011 -0400| [688b09fa597804ab4708271ce467a6ae025f0c17] | committer: Justin Ruggles
If AVCodecContext.channels is 0 and AVCodecContext.channel_layout is
non-zero, set channels based on channel_layout.
This allows the user to set only channel_layout and not channels.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=688b09fa597804ab4708271ce467a6ae025f0c17
---
libavcodec/utils.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e4ea1e5..6844188 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -584,6 +584,8 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
ret = AVERROR(EINVAL);
goto free_and_end;
}
+ } else if (avctx->channel_layout) {
+ avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
}
}
More information about the ffmpeg-cvslog
mailing list