From a8018961fcad5af9dde6b2ed78445983fd13509a Mon Sep 17 00:00:00 2001 From: Asd-g <65298684+Asd-g@users.noreply.github.com> Date: Sun, 7 Apr 2024 03:31:06 +0300 Subject: [PATCH] LWLibavAudioSource: set default output channel layout (#64) Regression from 2df8afd77f3518ba57dc38bef31dfa463407acde. --- AviSynth/audio_output.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AviSynth/audio_output.cpp b/AviSynth/audio_output.cpp index 13b86620..e77be3d1 100644 --- a/AviSynth/audio_output.cpp +++ b/AviSynth/audio_output.cpp @@ -66,7 +66,11 @@ void as_setup_audio_rendering if ( channel_layout != 0 ) av_channel_layout_from_string(&aohp->output_channel_layout, channel_layout ); else - av_channel_layout_copy(&aohp->output_channel_layout, &ctx->ch_layout ); + { + av_channel_layout_copy(&aohp->output_channel_layout, &ctx->ch_layout); + if (aohp->output_channel_layout.order == AV_CHANNEL_ORDER_UNSPEC) + av_channel_layout_default(&aohp->output_channel_layout, aohp->output_channel_layout.nb_channels); + } /* Sample rate. */ if( sample_rate > 0 ) aohp->output_sample_rate = sample_rate;