From patchwork Mon Dec 13 15:20:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 32426 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp5573333iog; Mon, 13 Dec 2021 07:23:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQY1KrDj2gM94RD/ZG064RHPM7IL0pGk8jtV57yoY+OZK/Ldh1RB9HQ2Z5o0UXL7trbnxO X-Received: by 2002:a17:907:20e8:: with SMTP id rh8mr44241695ejb.437.1639409000237; Mon, 13 Dec 2021 07:23:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639409000; cv=none; d=google.com; s=arc-20160816; b=o2RGhZ9vdn3u1+vDdwD+d+hz9nhU0y85jw7JHDM80ceHTDS/XLNLU90jO9cMW+mvfA lCcl8fNZKMJeN6lVHsSUCRCzGKznqPA+n8q+PJ1w6812+R+NqQQsirRRn1nAlsun+DGX HlbeILyeuSl1fYPvUNao90EI63XN+CJ07EkFin1njFozmcRJcHsoMknn1ZJBZYE71a1a ZhFLBEnQ7aXTcxYb31VR0cstCOY8j07PwIPaA4M5APj6UC6DcdbRwFYCMMzHyM0B5D2e vOhyIS89X1EFAr2QmCP3/cQ7RRJHIJ2WZPFKQnjC8u9v37BRQXXwC8ZRV4KD4hQVb+jQ el+g== 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=s7+iZ3j/JJrTucdg54sev1F90/Sku0tfLemDStd9XwA=; b=aiMDeyC9HY8xfId1sAQdTtcKOzH3Yc/L9qpHJeAe5ED7L0qyRv3Xg7GvxBU/IiXd0N Mt8z3xoO0ek2tGbd5wY2CV+cPmPp8DnxyFGHcQWeyvfLBxRLRV6kVqyRSiH2KpVykGBs uz5mb3MNfooZ4iYQ6XBFK167KoWEZg43rifcu6+7LXUM1PljP1OvE+92qeJYmkw8rjoN VoUYH00d0D8BOMW+yrcyfT8QzV6PdfPd7kbAGcZh66LdsqMHmxmdk61aZEUxBlMBzLtH qvlqj/XRLj2z9OX6bwaJRxthu+PMZngeXrcskyOXCpUw8Z7EZddiRoLKL+fY1NvuuXKq hX0A== 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 mp32si19820025ejc.237.2021.12.13.07.23.19; Mon, 13 Dec 2021 07:23:20 -0800 (PST) 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 02FAA68AF96; Mon, 13 Dec 2021 17:22:21 +0200 (EET) 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 4E27868AFA1 for ; Mon, 13 Dec 2021 17:22:14 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 1B5D8240507 for ; Mon, 13 Dec 2021 16:22:10 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 0INwrVHVfE5A for ; Mon, 13 Dec 2021 16:22:09 +0100 (CET) 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 9353824050B for ; Mon, 13 Dec 2021 16:22:07 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 355B23A09E6; Mon, 13 Dec 2021 16:22:07 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Dec 2021 16:20:29 +0100 Message-Id: <20211213152042.5900-11-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211213152042.5900-1-anton@khirnov.net> References: <20211213152042.5900-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: uSwa2UIMsmtI 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; }