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 F18FF422D9 for ; Fri, 17 Dec 2021 09:44:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E237768A569; Fri, 17 Dec 2021 11:44:32 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 81958687F96 for ; Fri, 17 Dec 2021 11:44:26 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 31CF624017C for ; Fri, 17 Dec 2021 10:44:26 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id xCpfJ0U4cC-d for ; Fri, 17 Dec 2021 10:44:25 +0100 (CET) Received: from lain.red.khirnov.net (lain.red.khirnov.net [IPv6:2001:67c:1138:4306::3]) (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 "lain.red.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 8424E240179 for ; Fri, 17 Dec 2021 10:44:25 +0100 (CET) Received: by lain.red.khirnov.net (Postfix, from userid 1000) id 6F9BE16008E; Fri, 17 Dec 2021 10:44:22 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: =?utf-8?q?=3CAM7PR03MB66607C265FA741C6467DD5D48F779=40AM7PR03MB?= =?utf-8?q?6660=2Eeurprd03=2Eprod=2Eoutlook=2Ecom=3E?= References: <20211213152042.5900-1-anton@khirnov.net> <20211213152042.5900-11-anton@khirnov.net> =?utf-8?q?=3CAM7PR03MB66607C265F?= =?utf-8?q?A741C6467DD5D48F779=40AM7PR03MB6660=2Eeurprd03=2Eprod=2Eoutlook?= =?utf-8?q?=2Ecom=3E?= Mail-Followup-To: FFmpeg development discussions and patches Date: Fri, 17 Dec 2021 10:44:22 +0100 Message-ID: <163973426286.13029.4030365117544324740@lain.red.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 11/24] ffmpeg: set want_sdp when initializing the muxer 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: Quoting Andreas Rheinhardt (2021-12-16 22:40:31) > Anton Khirnov: > > Allows making the variable local to ffmpeg_mux. > > --- > > fftools/ffmpeg.c | 9 +-------- > > fftools/ffmpeg.h | 1 - > > fftools/ffmpeg_mux.c | 5 +++++ > > 3 files changed, 6 insertions(+), 9 deletions(-) > > > > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c > > index 3ed1201fda..f76e5df8d2 100644 > > --- a/fftools/ffmpeg.c > > +++ b/fftools/ffmpeg.c > > @@ -138,8 +138,6 @@ static int nb_frames_drop = 0; > > static int64_t decode_error_stat[2]; > > unsigned nb_output_dumped = 0; > > > > -int want_sdp = 1; > > - > > static BenchmarkTimeStamps current_time; > > AVIOContext *progress_avio = NULL; > > > > @@ -4557,7 +4555,7 @@ static void log_callback_null(void *ptr, int level, const char *fmt, va_list vl) > > > > int main(int argc, char **argv) > > { > > - int i, ret; > > + int ret; > > BenchmarkTimeStamps ti; > > > > init_dynload(); > > @@ -4600,11 +4598,6 @@ int main(int argc, char **argv) > > exit_program(1); > > } > > > > - for (i = 0; i < nb_output_files; i++) { > > - if (strcmp(output_files[i]->format->name, "rtp")) > > - want_sdp = 0; > > - } > > - > > current_time = ti = get_benchmark_time_stamps(); > > if (transcode() < 0) > > exit_program(1); > > diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h > > index 67ff391334..4aed24c2a7 100644 > > --- a/fftools/ffmpeg.h > > +++ b/fftools/ffmpeg.h > > @@ -646,7 +646,6 @@ extern char *qsv_device; > > #endif > > extern HWDevice *filter_hw_device; > > > > -extern int want_sdp; > > extern unsigned nb_output_dumped; > > extern int main_return_code; > > > > diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c > > index aba4b563a4..e6417cdb8c 100644 > > --- a/fftools/ffmpeg_mux.c > > +++ b/fftools/ffmpeg_mux.c > > @@ -38,6 +38,8 @@ struct Muxer { > > int header_written; > > }; > > > > +static int want_sdp = 1; > > + > > static void close_all_output_streams(OutputStream *ost, OSTFinished this_stream, OSTFinished others) > > { > > int i; > > @@ -349,6 +351,9 @@ int of_muxer_init(OutputFile *of, uint64_t limit_filesize) > > > > mux->limit_filesize = limit_filesize; > > > > + if (strcmp(of->format->name, "rtp")) > > + want_sdp = 0; > > + > > return 0; > > } > > > > > > This variable could actually be completely local to > check_init_output_file()/of_check_init(). If we are to have global variables at all (I'd prefer we didn't), I'd rather have them visible, not hidden inside functions. -- Anton Khirnov _______________________________________________ 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".