From patchwork Thu Apr 13 14:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41163 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp1289439pzb; Thu, 13 Apr 2023 07:19:15 -0700 (PDT) X-Google-Smtp-Source: AKy350ZL6HsVqimcDf8AC4rlRQsLj/dq42jO7efmaNkPsYPVy9v0wUSgJ7zgFHi+9/TnKi33SzH2 X-Received: by 2002:a17:907:6b8e:b0:94a:56ec:7f12 with SMTP id rg14-20020a1709076b8e00b0094a56ec7f12mr3067950ejc.30.1681395555200; Thu, 13 Apr 2023 07:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681395555; cv=none; d=google.com; s=arc-20160816; b=crUbvI68N71/DUtSRDpOTM+/oP7lbBScH7qcTO/m6sPfMqZ3p5B3utH6IoU5z3vTpz 8b8ktXSVV7w8vZJwyfgLCbvMxKUL+xQbnLc7ej44qmGMbaQ1jZpwERG5Xzun4MM5UtM5 k4wZeoEyAf4iqGvLfOfBv0WL18uolNzmK9CPFuWLTllLQ4l5yGQbu6uykZLSA2LucNoH 2dLS9tJDMzaweqFHhWXzkqrtoT/TjVUQh+qMfiD3lizso4CwSfW194hVIVvOipRnaaT6 FtwrPGoGMPwahOnU8TG6ra4vrTIsdpTvAe3BkGpgci9QTM5lJcnQ5Dc5d6vQGZzdpjTJ lVvA== 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=kNty7dsZd3+/kNJ11aIPigM6ao4mzuLS9eT23bX119k=; b=sSataTl23EpRM2EjSpnU+/Q7vWtu26/RgSXT3afnW/dTQ9GEuW9TWpmkUj/iaf9mQF sj1jW8CnwSPi/KzybODCk3JYNhLaCOAc2jrb5XL2IpN7U0ofGPxTJqCUKOhWmCiU6j7S v1mrUYh8oaNObSNeWRW7xa8Y8YrmDgxV5a5WoCNblV9Z+safKvqmXQnlz5mAhXpbrthH rOUplP24i6so5QW2+iTONN74vkN6adngVa5ojm9S3Wc46S0EDtO4K4emXkiwziD07B26 xUStMRz+ymAqYkO+7CJP+C4Zw727lEU+YYIQwXnvvnsU7j/zPYxxywMP4d2QtGbWHhAt lWgg== 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 fd20-20020a1709072a1400b0094e7224b495si1798112ejc.544.2023.04.13.07.19.14; Thu, 13 Apr 2023 07:19:15 -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 E0E2568BED5; Thu, 13 Apr 2023 17:16:14 +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 D2DCE68BE4A for ; Thu, 13 Apr 2023 17:16:04 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 9A0BF2405EC for ; Thu, 13 Apr 2023 16:16:04 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Cs2EkvpE2YbJ for ; Thu, 13 Apr 2023 16:16:03 +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 DEFAE240D1E for ; Thu, 13 Apr 2023 16:15:53 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id CF0293A03E5 for ; Thu, 13 Apr 2023 16:15:53 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 Apr 2023 16:12:21 +0200 Message-Id: <20230413141223.17245-23-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230413141223.17245-1-anton@khirnov.net> References: <20230413141223.17245-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_mux: make copy_prior_start private to muxing code 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: GmVBSPDd5M9X It is no longer used outside of ffmpeg_mux* --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_mux.c | 2 +- fftools/ffmpeg_mux.h | 1 + fftools/ffmpeg_mux_init.c | 6 +++--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index cc72b1cb6e..25c33cf207 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -659,7 +659,6 @@ typedef struct OutputStream { const char *attachment_filename; int copy_initial_nonkeyframes; - int copy_prior_start; int keep_pix_fmt; diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 01ccac55ce..f52205cf30 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -398,7 +398,7 @@ void of_streamcopy(OutputStream *ost, const AVPacket *pkt, int64_t dts) return; if (!ms->streamcopy_started) { - if (!ost->copy_prior_start && + if (!ms->copy_prior_start && (pkt->pts == AV_NOPTS_VALUE ? dts < ms->ts_copy_start : pkt->pts < av_rescale_q(ms->ts_copy_start, AV_TIME_BASE_Q, pkt->time_base))) diff --git a/fftools/ffmpeg_mux.h b/fftools/ffmpeg_mux.h index 0938a261ee..81c4698161 100644 --- a/fftools/ffmpeg_mux.h +++ b/fftools/ffmpeg_mux.h @@ -75,6 +75,7 @@ typedef struct MuxStream { // combined size of all the packets sent to the muxer uint64_t data_size_mux; + int copy_prior_start; int streamcopy_started; } MuxStream; diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 48efaef664..bfa84f5a28 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -908,7 +908,7 @@ static int streamcopy_init(const Muxer *mux, const OptionsContext *o, if (ost->st->duration <= 0 && ist->st->duration > 0) ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); - if (!ost->copy_prior_start) { + if (!ms->copy_prior_start) { ms->ts_copy_start = (mux->of.start_time == AV_NOPTS_VALUE) ? 0 : mux->of.start_time; if (copy_ts && ifile->start_time != AV_NOPTS_VALUE) { @@ -1156,8 +1156,8 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, } } - ost->copy_prior_start = -1; - MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st); + ms->copy_prior_start = -1; + MATCH_PER_STREAM_OPT(copy_prior_start, i, ms->copy_prior_start, oc ,st); MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, oc, st); if (bsfs && *bsfs) {