From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 47E6648E8E for ; Fri, 29 Mar 2024 22:02:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9149D68D44E; Sat, 30 Mar 2024 00:02:09 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 09E0268BD24 for ; Sat, 30 Mar 2024 00:02:02 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DE23DEA1CE for ; Fri, 29 Mar 2024 23:02:01 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a1teoli5uqaa for ; Fri, 29 Mar 2024 23:01:59 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id CC9B7E9D31 for ; Fri, 29 Mar 2024 23:01:58 +0100 (CET) Date: Fri, 29 Mar 2024 23:01:58 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20240323152625.20980-1-cus@passwd.hu> Message-ID: <0d31fdea-5f4c-82b8-bd98-f4bccf409665@passwd.hu> References: <20240323152625.20980-1-cus@passwd.hu> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avfilter/buffersrc: fix overriding unknown channel layouts with negotiated one X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sat, 23 Mar 2024, Marton Balint wrote: > Fixes ffplay playback of unknown layouts, when SDL directly supports the audio > format, such as: > > ffplay -f lavfi anullsrc=cl=2C,aformat=s16 > > Without the patch, "Channel layout change is not supported" errors are > generated because buffersrc (unknown 2 channel) and buffersink (stereo) > negotiated a stereo layout, but the stereo layout was never stored in the > BufferSourceContext. > > This fixes a regression of 7251f909721a570726775acf61b2b9c28a950c76, but this > is more of a regression of the avfilter channel layout conversion > (1f96db959c1235bb7079d354e09914a0a2608f62). > > Signed-off-by: Marton Balint > --- > libavfilter/buffersrc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c > index ddcd403785..fcae4f8e69 100644 > --- a/libavfilter/buffersrc.c > +++ b/libavfilter/buffersrc.c > @@ -507,7 +507,7 @@ static int config_props(AVFilterLink *link) > } > break; > case AVMEDIA_TYPE_AUDIO: > - if (!c->ch_layout.nb_channels) { > + if (!c->ch_layout.nb_channels || c->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { > int ret = av_channel_layout_copy(&c->ch_layout, &link->ch_layout); > if (ret < 0) > return ret; Will apply and backport. Regards, Marton _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".