From patchwork Thu Apr 27 14:25:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41369 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp563631pzb; Thu, 27 Apr 2023 07:27:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tlm+W1NdgdOlZ88OGmBwNXWk+yF5/wfjblGPZjywucvMNxHnDuv9aJSy4gNqO3GTx2Axd X-Received: by 2002:aa7:d391:0:b0:506:b211:489 with SMTP id x17-20020aa7d391000000b00506b2110489mr1579656edq.35.1682605646719; Thu, 27 Apr 2023 07:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682605646; cv=none; d=google.com; s=arc-20160816; b=eGoqxchxcZzYJIXaF+JEdyQXr96ytYxmeUj5Ju1oyzoD0JFpsYGB8OdeQC8hUzw2ZF NIT7JFD73u1zE5MQ1Phs5nWInvM6ffIF5u2kPSdiEShoNB8TuWy23rYhG3ZJRrHHQZke mUrHduRaG33aj/ajMDvfjvLmxOA67Zyw4ObjAByxCvJXINelAkMJ/NHtnB957IFb1YsS wxPqHbcynegtznx/jquxkCm5ohJ2m7UMgzmhAH9DX+mQoJE/c6063NkFpZO+Z8FI7ZrJ 8gofV80XAdZMyIw820EBowu4KiSy9sVoX1ptO1W8Nn4bLSlZTRb0KhZCseDYSvNYzOcr 2b/Q== 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=5RP3UK8EegnhCA6GiwxT2tZS156sSifrqNTlGjrduJY=; b=YBZZqppYOHWfSk2AtI6nMDf9r8jctZfM5JJdiM9R2DgiNJVsqrapp0lATe0BlREeP+ KDmxCfmaC30b9SBqspsQfdwLv6aPHsMW5fssG/7YRHKFX4DOEOSwGzC9gXhcGtf9wJca wt/++x79aT7yHp94S+p+rn1xuGK3gbm+ZNw7b6ZdStOTzeLJ4CwalptlIMBx6lVS4n23 FO+hVuAgBXi7YSagxBnV4XGUu+Ey6bGFbyWq9HL+SYX7EUYeaek4hKOMppcuViOSqSvo LRBVcSoDGCtvKF1SELM50V2eshzelk6HAdlUgktxgfrIFyuB+lIwr+6jdTClq9jNh8fS PvlA== 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 r22-20020aa7cfd6000000b0050847f2103fsi13651332edy.687.2023.04.27.07.27.21; Thu, 27 Apr 2023 07:27:26 -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 3F09D68BFBB; Thu, 27 Apr 2023 17:26:21 +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 3BD4468BF51 for ; Thu, 27 Apr 2023 17:26:13 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 07D512404EC for ; Thu, 27 Apr 2023 16:26:13 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Q7wEc8MQkQrY for ; Thu, 27 Apr 2023 16:26:10 +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 A65412406CF for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 984903A031B for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Apr 2023 16:25:54 +0200 Message-Id: <20230427142601.2613-14-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230427142601.2613-1-anton@khirnov.net> References: <20230427142601.2613-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 14/21] fftools/ffmpeg: stop using packet pts for decoded audio 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: jIsEZg/Y/qZ3 If input packets have timestamps, they will be propagated to output frames by the decoder, so at best this block does not do anything. There can also be an arbitrary amount of delay between packets sent to the decoder and decoded frames (e.g. due to decoder's intrinsic delay or frame threading), so deriving any timestamps from packet properties is wrong. --- fftools/ffmpeg.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index eae0093cce..5913a57d16 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -911,9 +911,6 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output, if (decoded_frame->pts != AV_NOPTS_VALUE) { decoded_frame_tb = ist->st->time_base; - } else if (pkt && pkt->pts != AV_NOPTS_VALUE) { - decoded_frame->pts = pkt->pts; - decoded_frame_tb = pkt->time_base; }else { decoded_frame->pts = ist->dts; decoded_frame_tb = AV_TIME_BASE_Q;