From patchwork Thu Jun 16 19:55:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36258 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp1127422pzb; Thu, 16 Jun 2022 13:03:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1viPrZN4mZZvbu4wLDtirQK9kn0kxKxWJzlNmWydjSfL9cRFJsZ/w/WsW1cWfTf518DZDX3 X-Received: by 2002:a17:907:7da2:b0:711:f36e:b855 with SMTP id oz34-20020a1709077da200b00711f36eb855mr6159366ejc.308.1655409835799; Thu, 16 Jun 2022 13:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655409835; cv=none; d=google.com; s=arc-20160816; b=CYSBCbbTg2WuTiG06S23YDi6A9o73X1mIwP7n9V0m5GOuDkxWrtTy5p0nyByCb64RB oa+qjYPX7uKq49KcJjKpG8O8qt30MoP389qpuG0YnCHJTUh1kURn88jv+X4yfs7vdNNh S4AjUgeHgSOVUiTGoimbiGXvZ6PMXFiesagbeGQUEDgUCG7OwtDYJ7i692af36Nrk9h5 jH+7ZpCvPY5gy+DpFz980PKlKi+tofw7RmJxC60gcI3xaMREo+xboFF/EluZndFuOhim 6i59VN5IEgWmRhDpnzSWT3nsU9QzkZylFFZeZALRVCjiTmAp+efrggtPzJRfEoebbd+2 DzHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=kyNdR/6jsa646si/p0dTeBzkiYuGbwj5+2HmZR3v7u4=; b=J5Ymkr5xV4iFFVzUGVuTucUkP2BTLsnYB6RApDBO2uvJzF1nf3Y/Pb07AxWA1DfVuL dnk4mNi6tk9RuxPhl83zJJDk9oGHEHZMUw9w9p+99Bp04p8GmYcB8A7A/F/w7ecDJ/hC BCJNV9Qik7/j9l1u4N6/QdZZJuqV/0epI8EkI7J+LCEnSE865qs8OEDDtwwBmSwEpgpr df2g3+gSK9MR0VNh0O4v9TgzMJk4XMh8266XBbkQFddztH4J7mqhf6vsNdwQJ8llEC+1 hKs1qp6ykoIvJTAcudzmLJf8H4tS5gPiRwch7W7ijOUj5R4rpXBlEzdVHNmnz6h7PzXT 3HHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f39-20020a05640232a700b00425d3e0c7a9si3247787eda.151.2022.06.16.13.03.55; Thu, 16 Jun 2022 13:03:55 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F237068B810; Thu, 16 Jun 2022 23:03:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EF6F968B7B3 for ; Thu, 16 Jun 2022 23:03:34 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id ABF1224069C for ; Thu, 16 Jun 2022 22:03:34 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id KOjBw54bwv9L for ; Thu, 16 Jun 2022 22:03:34 +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 9F55B24017E for ; Thu, 16 Jun 2022 22:03:33 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 8AA6B3A1249; Thu, 16 Jun 2022 22:03:30 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Jun 2022 21:55:04 +0200 Message-Id: <20220616195534.5278-5-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616195534.5278-1-anton@khirnov.net> References: <20220616195534.5278-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/35] fftools/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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: SO1Z2sWBeO9Q 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 8d5f071fd1..51616cf51d 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -137,8 +137,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; @@ -4505,7 +4503,7 @@ static int64_t getmaxrss(void) int main(int argc, char **argv) { - int i, ret; + int ret; BenchmarkTimeStamps ti; init_dynload(); @@ -4541,11 +4539,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 a97cd2a8e4..e3cf7794e6 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -654,7 +654,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 207231f33b..db04b7858d 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; @@ -335,6 +337,9 @@ int of_muxer_init(OutputFile *of, int64_t limit_filesize) mux->limit_filesize = limit_filesize; + if (strcmp(of->format->name, "rtp")) + want_sdp = 0; + return 0; }