From 615aac5c4719ff59dc6f44bc393af346ceaefb66 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 24 Sep 2024 08:53:03 +0200 Subject: [PATCH] Fix setting avfilter channel count, similar to what was done in link_avfilter --- src/modules/avformat/filter_avfilter.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/avformat/filter_avfilter.c b/src/modules/avformat/filter_avfilter.c index 06bc8101f..62fc6a1fa 100644 --- a/src/modules/avformat/filter_avfilter.c +++ b/src/modules/avformat/filter_avfilter.c @@ -288,15 +288,6 @@ static void init_audio_filtergraph(mlt_filter filter, mlt_log_error(filter, "Cannot set sink sample rates\n"); goto fail; } - ret = av_opt_set_int_list(pdata->avbuffsink_ctx, - "channel_counts", - channel_counts, - -1, - AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - mlt_log_error(filter, "Cannot set sink channel counts\n"); - goto fail; - } #if HAVE_FFMPEG_CH_LAYOUT ret = av_opt_set(pdata->avbuffsink_ctx, "ch_layouts", @@ -307,6 +298,15 @@ static void init_audio_filtergraph(mlt_filter filter, goto fail; } #else + ret = av_opt_set_int_list(pdata->avbuffsink_ctx, + "channel_counts", + channel_counts, + -1, + AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + mlt_log_error(filter, "Cannot set sink channel counts\n"); + goto fail; + } ret = av_opt_set_int_list(pdata->avbuffsink_ctx, "channel_layouts", channel_layouts,