From patchwork Wed Jul 13 09:17:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36768 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp225750pzb; Wed, 13 Jul 2022 02:17:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uL2j/JZQywbamOhPXd8xZ05GN6BTcwAYzelB8nFm2LMAtYWRbiLqA44OzTuWA8iaAv1BTA X-Received: by 2002:a17:907:2c5b:b0:72b:54bd:40f8 with SMTP id hf27-20020a1709072c5b00b0072b54bd40f8mr2426430ejc.137.1657703877216; Wed, 13 Jul 2022 02:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657703877; cv=none; d=google.com; s=arc-20160816; b=MBcUmO+9Rj1tDyhLwZ6f7peQyGz2e30K9SRXn+wAi/OPSPU1QJTx5vkiYDoimaH1N2 Th5Z/EoRDz+7oOTz24JLmT9Qjobhmm7YKlSvjbNJbrtMnNuHF2h2QJXQyKiBPe9JwXaL 0VZroZ6gsCFWKbCQYUFOqsbFcWCMqxq8mJQk5tzoyVtPix1Jl/YlZ7TA67Y7VXKDp/0b +eg2ZdgILc0qeF68T6T6MY1nQDlQ1uVUrD7ItHgqFegqKk+qzXgNka5b7S98QJ7nRsR3 cUeKclFauaxEIcbAToP4l5dxCfU6wNWm/y2baYDb9XLVsSLIuENHbvMtHumJdL/lkWM7 DR1Q== 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=KsseY3VaGEA6Gtpa+xml07+PZdfX6eAg1Jc8Y7VyUqU=; b=PQlZlV/CrG5mstHNAEvyFk1RfOeDPBclpGgy66fH8A0foxwE296CgA4xgJgcSWR1f3 aHG62eQUfgpKyTJF4GskcSNXsOzvo3lfc2kztuDqcUXREn0nmPwQ/Hb1YWrcmlqJ3NE+ +2rOjyuj2zz0HfwlhAZkUwDOak57DjpP7cq6Ju83A/d4KiWxcp229E8xdsob0Sqzxs0t YVb5Bxbrgv/iTy6/L4eKt6PWtavBpbS2cVjd+3TWZsUlXp36MJM4tUuqBWkF9X/DosOH lzBHnUIQNzFzHmJNaq4rMIJkM16LHB5R9xdrVBRrLh6Y745u1JGOEFnzbbq6npsBSbaC sA/Q== 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 i1-20020a056402054100b0043aa8412569si14741668edx.315.2022.07.13.02.17.54; Wed, 13 Jul 2022 02:17:57 -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 4EB1668B8C9; Wed, 13 Jul 2022 12:17:39 +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 AEDFC68B87F for ; Wed, 13 Jul 2022 12:17:31 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 1FA97240512 for ; Wed, 13 Jul 2022 11:17:30 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id jpAbqd-w7xpR for ; Wed, 13 Jul 2022 11:17:28 +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 47CDC240179 for ; Wed, 13 Jul 2022 11:17:28 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id D4AF63A0333; Wed, 13 Jul 2022 11:17:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Jul 2022 11:17:20 +0200 Message-Id: <20220713091725.16638-4-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713091725.16638-1-anton@khirnov.net> References: <20220713091725.16638-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/9] lavf: use AVFrame.duration instead of AVFrame.pkt_duration 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: FBzQiNFdXxYm --- libavformat/mux.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index 31361f9b46..a3b50dadb6 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1417,7 +1417,14 @@ static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index, pkt->size = sizeof(frame); pkt->pts = pkt->dts = frame->pts; - pkt->duration = frame->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (frame->pkt_duration) + pkt->duration = frame->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt->duration = frame->duration; pkt->stream_index = stream_index; pkt->flags |= AV_PKT_FLAG_UNCODED_FRAME; }