From 237b063843dd069ff79d2de890e10ea9c5abfccb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 29 Sep 2022 12:42:21 +0100 Subject: [PATCH] avauddec: fix unnecessary reconfiguration if the audio layout isn't specified It would constantly want to renegotiate (and spam the debug log) even though the channel layout hasn't actually changed. We use the same fallback in gst_ffmpegauddec_negotiate() already. This happens with WMA files for example. Part-of: --- subprojects/gst-libav/ext/libav/gstavauddec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-libav/ext/libav/gstavauddec.c b/subprojects/gst-libav/ext/libav/gstavauddec.c index 4bdb197..68ab1dc 100644 --- a/subprojects/gst-libav/ext/libav/gstavauddec.c +++ b/subprojects/gst-libav/ext/libav/gstavauddec.c @@ -358,6 +358,9 @@ settings_changed (GstFFMpegAudDec * ffmpegdec, AVFrame * frame) GstAudioLayout layout; gint channels = av_get_channel_layout_nb_channels (frame->channel_layout); + if (channels == 0) + channels = frame->channels; + format = gst_ffmpeg_smpfmt_to_audioformat (frame->format, &layout); if (format == GST_AUDIO_FORMAT_UNKNOWN) return TRUE; -- 2.7.4