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 79BB9401CF for ; Tue, 18 Oct 2022 12:39:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 64AD068BD79; Tue, 18 Oct 2022 15:38:27 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D012068BD13 for ; Tue, 18 Oct 2022 15:38:20 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id EFC682405F9 for ; Tue, 18 Oct 2022 14:38:18 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id w3CgPU7fHOaj for ; Tue, 18 Oct 2022 14:38:18 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id C03B62406CD for ; Tue, 18 Oct 2022 14:38:13 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id D80E33A1E7C for ; Tue, 18 Oct 2022 14:38:13 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 18 Oct 2022 14:36:59 +0200 Message-Id: <20221018123701.25002-18-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221018123701.25002-1-anton@khirnov.net> References: <20221018123701.25002-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 18/20] fftools/ffmpeg_mux_init: stop modifying OptionsContext.*_disable 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The current code will override the *_disable fields (set by -vn/-an options) when creating output streams for unlabeled complex filtergraph outputs, in order to disable automatic mapping for the corresponding media type. However, this will apply not only to automatic mappings, but to manual ones as well, which should not happen. Avoid this by adding local variables that are used only for automatic mappings. --- fftools/ffmpeg_mux_init.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 6687ba872a..7c19cb7442 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1064,6 +1064,11 @@ loop_end: static void create_streams(Muxer *mux, OptionsContext *o) { + int auto_disable_v = o->video_disable; + int auto_disable_a = o->audio_disable; + int auto_disable_s = o->subtitle_disable; + int auto_disable_d = o->data_disable; + /* create streams for all unlabeled output pads */ for (int i = 0; i < nb_filtergraphs; i++) { FilterGraph *fg = filtergraphs[i]; @@ -1074,9 +1079,9 @@ static void create_streams(Muxer *mux, OptionsContext *o) continue; switch (ofilter->type) { - case AVMEDIA_TYPE_VIDEO: o->video_disable = 1; break; - case AVMEDIA_TYPE_AUDIO: o->audio_disable = 1; break; - case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break; + case AVMEDIA_TYPE_VIDEO: auto_disable_v = 1; break; + case AVMEDIA_TYPE_AUDIO: auto_disable_a = 1; break; + case AVMEDIA_TYPE_SUBTITLE: auto_disable_s = 1; break; } init_output_filter(ofilter, o, mux); } @@ -1084,13 +1089,13 @@ static void create_streams(Muxer *mux, OptionsContext *o) if (!o->nb_stream_maps) { /* pick the "best" stream of each type */ - if (!o->video_disable) + if (!auto_disable_v) map_auto_video(mux, o); - if (!o->audio_disable) + if (!auto_disable_a) map_auto_audio(mux, o); - if (!o->subtitle_disable) + if (!auto_disable_s) map_auto_subtitle(mux, o); - if (!o->data_disable) + if (!auto_disable_d) map_auto_data(mux, o); } else { for (int i = 0; i < o->nb_stream_maps; i++) -- 2.35.1 _______________________________________________ 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".