From patchwork Thu Jun 16 19:55:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36287 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp1129672pzb; Thu, 16 Jun 2022 13:08:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v3ebpRlBuJw4oPt/MPfdi4jheHerK6hmB2507M7mpcz2GqVsa+vnKxmH6CrlRGPthj8W+o X-Received: by 2002:a17:906:ae92:b0:711:2b64:c829 with SMTP id md18-20020a170906ae9200b007112b64c829mr6184197ejb.89.1655410110485; Thu, 16 Jun 2022 13:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655410110; cv=none; d=google.com; s=arc-20160816; b=JSbIa7xPopba5efqLk3zEqzwOMsP4bTaPHjtto4hhJ8tvEpwDZQTRekfALleAO0BOU hHTYoN5sj4vQoloFfat+rIwmfdliQv4i6URK81abAN8FKAJVcaeR6voPCnU3YJn6EB3K T2YpiC8n2LRCFpGVXpYxmlZVm72UlGor4PvKUtRCB2wTt93O73TYcuToHiy463Tqn3jY W3TCeH7mplv2HSck+BCpXBckUwy/Y6JC0kunaU5bIXGGAH4pAaNPgLYDtLOlJqh60AJv FavQhx+SOk4Ppv3IBHoHfK+Tb6pUWA3GE80pnZyZoblIPUVyZGJosoXFPwbSKX773936 z9wA== 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=2BDOmRDmxRTm0V1jUz8Weelms56PBjBALLD0PCJf4j4=; b=D7Ne8xWEDSShCREkD6AIAu1di2GJauqqJ/EAIkimpXROEUW8ndG73y6ePtkdPO56sX 026fTFGn3IvExJQpZw9cg23YitNB/Uj8c2cNhh9MfvYChp/EoaGtEjnVgV3ZjV6oXvXX AqFxI99YPouZJCeU9UG0R7RCPAAdBiuGDDssYL10hIDQYtIeDKKjme66YFWNoalz78y9 nwMrep745XLvW45d7B6DYBH+rxKQLa6EuCStKq1VMKbNMY4sgrJllaJ/Pd9D4qA7NumJ peaSUhfn9L/iwxOBjA+e6PU3y9piX+wnfaOx9KtMMtv+gE1lMmj9hiBoMkIlNY7/tkTY EjdQ== 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 qa19-20020a170907869300b00718c1086665si3028096ejc.328.2022.06.16.13.08.30; Thu, 16 Jun 2022 13:08:30 -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 7FAA268B8EC; Thu, 16 Jun 2022 23:04:09 +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 B111B68B85A for ; Thu, 16 Jun 2022 23:03:44 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 2C9E224017E for ; Thu, 16 Jun 2022 22:03:44 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id vNgbwkcXYFw0 for ; Thu, 16 Jun 2022 22:03:43 +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 6B40524068F for ; Thu, 16 Jun 2022 22:03:34 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 14C103A2214; Thu, 16 Jun 2022 22:03:31 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Jun 2022 21:55:31 +0200 Message-Id: <20220616195534.5278-32-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 32/35] fftools/ffmpeg: stop using av_stream_get_end_pts() 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: WD1Udt3TZFDh It retrieves the muxer's internal timestamp with under-defined semantics. Continuing to use this value would also require synchronization once the muxer is moved to a separate thread. Replace the value with last_mux_dts. --- fftools/ffmpeg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 5df453c2d9..f57028b9b7 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1658,9 +1658,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti vid = 1; } /* compute min output value */ - if (av_stream_get_end_pts(ost->st) != AV_NOPTS_VALUE) { - pts = FFMAX(pts, av_rescale_q(av_stream_get_end_pts(ost->st), - ost->st->time_base, AV_TIME_BASE_Q)); + if (ost->last_mux_dts != AV_NOPTS_VALUE) { + pts = FFMAX(pts, ost->last_mux_dts); if (copy_ts) { if (copy_ts_first_pts == AV_NOPTS_VALUE && pts > 1) copy_ts_first_pts = pts;