I sent an alternative approach last night.

On 9/9/2022 3:20 PM, Zhao Zhili wrote:
From: Zhao Zhili <zhiliz...@tencent.com>

Fix #9908. Regression since 8a5896ec1f6.

Signed-off-by: Zhao Zhili <zhiliz...@tencent.com>
---
  libswresample/swresample.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 6f04d130d3..624309c2a0 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -265,12 +265,14 @@ av_cold int swr_init(struct SwrContext *s){
          av_channel_layout_describe(&s->in_ch_layout, l1, sizeof(l1));
          av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or 
unsupported.\n", l1);
          av_channel_layout_uninit(&s->in_ch_layout);
+        s->in.ch_count = 0;
      }
if (!av_channel_layout_check(&s->out_ch_layout) || s->out_ch_layout.nb_channels > SWR_CH_MAX) {
          av_channel_layout_describe(&s->out_ch_layout, l2, sizeof(l2));
          av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or 
unsupported.\n", l2);
          av_channel_layout_uninit(&s->out_ch_layout);
+        s->out.ch_count = 0;
      }
switch(s->engine){
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to