From patchwork Sat Nov 26 08:19:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39457 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp6013393pzb; Sat, 26 Nov 2022 00:20:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf7mojZ3gPLWkUZKem+tWiT9qNO2o7If6l6vJqTqSlM1FhEC4wikdi8pG1Eis+qxKdEVdb56 X-Received: by 2002:a17:906:f6c6:b0:78d:b367:20c1 with SMTP id jo6-20020a170906f6c600b0078db36720c1mr33730357ejb.530.1669450840942; Sat, 26 Nov 2022 00:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669450840; cv=none; d=google.com; s=arc-20160816; b=cAoAYtTL4SUf3QurypIkoi1wFw37pOGqDiJtexn2Wq7ZBJvJE1fMMARLS4G7sreO+B sH3G45Fx23DaaaoVF51C7vzkZt0kJrq6T0zsss3S36LBE+c16LxcEMMaEIkgkhsdVj7u 1pctDObFHYbDj0DwQVlntz5HhROYyAozCDkzfUeNBAfRbsEKD+7rxM7KIpqmesPDSm4C CpSYaNVOo7eY8wvXsU/2uShBM4a+dJakbvwWSscyDqNC1iwddFkc+opxTPX7MfB1A1jX k+lS7KgrAK6qI2G6aFpPPa2syK3q7dr3i4fX7gAZiJeRqXD+E8FPN0/r6VMlE4WarzuU 2big== 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=f6Q5iqWYVhSKvScIhyYmYpn2iAaupm3VA6a7+YtKu78=; b=ZPCNyCNEkjojvysq3uSYTaVC40eJ23EbRJAbZg9KFOrlrBzhvRTTPtFMmKg7Cjymf0 f7Rb8i+hihdyTej0l4zrgIas4/5w9AQcVBKb98AjbXdeMh4hmBMgYbMjCex4MR3NGcYk vsB2mImWyXxTCcuEdHOI1mjfbk3KrF3pLwzmW7NWgoM+wqBlG7pkoGPllOcag9HTXiDu YeWzmC8heeuq8cTbLSArjAwEbl3FPk9V2oqhjXBSB/I5h9J43qmhicMLAZwIk71dBL85 Q/tqhFc0GgwPE3G9rFqTSiSBTsGnbvgEveqcThdYD+XF3BjHl/2kc1JMXLXy0LV/ZxVa rdGw== 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 t20-20020a170906179400b007ae86742c20si4013227eje.282.2022.11.26.00.20.40; Sat, 26 Nov 2022 00:20:40 -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 1438568BA06; Sat, 26 Nov 2022 10:19:38 +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 0331968B883 for ; Sat, 26 Nov 2022 10:19:29 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id EE0CC2406C7 for ; Sat, 26 Nov 2022 09:19:26 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id eAtHhBjjU-qO for ; Sat, 26 Nov 2022 09:19:26 +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 B6A9A2406CA for ; Sat, 26 Nov 2022 09:19:23 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id A7F823A040A for ; Sat, 26 Nov 2022 09:19:23 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 26 Nov 2022 09:19:07 +0100 Message-Id: <20221126081911.31275-9-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221126081911.31275-1-anton@khirnov.net> References: <20221126081911.31275-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/13] fftools/ffmpeg: call check_recording_time() with actual frame 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: KAai/qHkRoO2 Not its estimated value that will not necessarily be used. --- fftools/ffmpeg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index cb65f26100..e56681a461 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -936,9 +936,6 @@ static void do_audio_out(OutputFile *of, OutputStream *ost, AVCodecContext *enc = ost->enc_ctx; int ret; - if (!check_recording_time(ost, ost->next_pts, ost->enc_ctx->time_base)) - return; - if (frame->pts == AV_NOPTS_VALUE) frame->pts = ost->next_pts; else { @@ -949,6 +946,9 @@ static void do_audio_out(OutputFile *of, OutputStream *ost, } frame->time_base = enc->time_base; + if (!check_recording_time(ost, frame->pts, frame->time_base)) + return; + ost->next_pts = frame->pts + frame->nb_samples; ret = submit_encode_frame(of, ost, frame);