From patchwork Sun Nov 27 17:03:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39503 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp6960218pzb; Sun, 27 Nov 2022 09:07:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf7G4owPAIVx9/mrsrMImAc67g686UeE+Sj6DH5/4ujLybo5uhU8ckCTzbZS8IDKCQjLE8wx X-Received: by 2002:a17:907:d60b:b0:7bc:dbd8:184b with SMTP id wd11-20020a170907d60b00b007bcdbd8184bmr10056121ejc.110.1669568864303; Sun, 27 Nov 2022 09:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669568864; cv=none; d=google.com; s=arc-20160816; b=HN6BajM33qe6IQUKSw/5zqPQwGCYRQa0rzfuOYi8XGXfR8bAcP3ckTzA8QVrS3D8DF bbSHdPlJY2BV2Sx4niHh8vmR5bVIvZ3vCXzI0Cqx/CH7E+d8kNzvYlQKelhyq5aQ4exr Vr1J2v4Reu9t/yykQKQPTjKkL7DqsL1QHLUJpt3EwGv/uLpah31Kfzno13Mdgnf0KwFG tkvzl0pYTw2O0O7ZX5SVk11/c5mXZPwz280OQ2RqC2DpPVMHtOkSLRUwO658mI3dasTZ JUR3GHK7EGwGERSbfJjpU3zVDBWueu43sqIsFUqsOOdAD1dRYEcAWsaKEt9YMgssII4i W3Ug== 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=qXDIkCjSh3TkDEavisf4UDf0FCvgL5ebOyA15DWGPu0=; b=kEEfwCBxIqL9mHzVNStJBbQmclVUYzL3cVXOEDzIshHqqitaZOk7sWvcU0bX+bXpMq j2836DF4eXdgJTkc3L6WxIzaFKzjv6+YUr+TZII4LJpx+y+09g1/psACyZ0q1IpWWSau aYiP9AwRnfmmwex3wrQ26nz3TunUrV7CCu2/FwEgUDb87sRfC/P8KgliPWy1B3eSUJH0 SdOiTJQimonL/O6sVCf/HmLge3coZKK5hOhWD9JeopxXy9tQECP3GWYk9ncs7/MwdePu 08F6XplvfpompoDfO32NEzxym18B3T4dZtL3AsrIDibRjwRXJmcszqDCR9qe7QTLG60V wexg== 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 ht10-20020a170907608a00b007ada03062e9si9423614ejc.415.2022.11.27.09.07.43; Sun, 27 Nov 2022 09:07:44 -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 26E27680C7B; Sun, 27 Nov 2022 19:06:10 +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 81E0368B90B for ; Sun, 27 Nov 2022 19:06:01 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 2DC802406CE for ; Sun, 27 Nov 2022 18:06:01 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id B6zxAhezNfc7 for ; Sun, 27 Nov 2022 18:05:59 +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 DE625240D1A for ; Sun, 27 Nov 2022 18:05:51 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 263C23A2661 for ; Sun, 27 Nov 2022 18:05:47 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 27 Nov 2022 18:03:50 +0100 Message-Id: <20221127170351.11477-29-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221127170351.11477-1-anton@khirnov.net> References: <20221127170351.11477-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 29/30] lavc/libx265: pass through frame durations to encoded packets 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: AumMHXazARU0 --- libavcodec/libx265.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 7ba547a7e7..088ddef3fc 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -43,6 +43,7 @@ typedef struct ReorderedData { int64_t reordered_opaque; + int64_t duration; void *frame_opaque; AVBufferRef *frame_opaque_ref; @@ -616,6 +617,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } rd = &ctx->rd[rd_idx]; + rd->duration = pic->duration; rd->reordered_opaque = pic->reordered_opaque; rd->frame_opaque = pic->opaque; if (pic->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { @@ -754,6 +756,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ReorderedData *rd = &ctx->rd[idx]; avctx->reordered_opaque = rd->reordered_opaque; + pkt->duration = rd->duration; if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { pkt->opaque = rd->frame_opaque;