This allows the user to set only channel_layout and not channels.
---
 libavcodec/utils.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e03a4c9..1f0a0c5 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);
         }
     }
 
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to