From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 434454395D for ; Wed, 4 Jan 2023 16:15:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E627B68BCBD; Wed, 4 Jan 2023 18:15:33 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EC35A688127 for ; Wed, 4 Jan 2023 18:15:26 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B41B6240499 for ; Wed, 4 Jan 2023 17:15:26 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 9bPzHKjL4-im for ; Wed, 4 Jan 2023 17:15:26 +0100 (CET) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (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 "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id F2EEA2400F5 for ; Wed, 4 Jan 2023 17:15:25 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id E25F71601B2; Wed, 4 Jan 2023 17:15:25 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20221127170351.11477-1-anton@khirnov.net> <20221127170351.11477-30-anton@khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Wed, 04 Jan 2023 17:15:25 +0100 Message-ID: <167284892589.4503.11493566644458858461@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 30/30] lavc/libaomenc: 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting James Almer (2022-11-27 21:19:33) > On 11/27/2022 2:03 PM, Anton Khirnov wrote: > > --- > > libavcodec/libaomenc.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c > > index bd576fdd3a..c117ca4ee6 100644 > > --- a/libavcodec/libaomenc.c > > +++ b/libavcodec/libaomenc.c > > @@ -1094,6 +1094,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, > > } > > memcpy(pkt->data, cx_frame->buf, pkt->size); > > pkt->pts = pkt->dts = cx_frame->pts; > > + pkt->duration = cx_frame->duration; > > > > if (!!(cx_frame->flags & AOM_FRAME_IS_KEY)) { > > pkt->flags |= AV_PKT_FLAG_KEY; > > @@ -1275,6 +1276,7 @@ static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, > > AOMContext *ctx = avctx->priv_data; > > struct aom_image *rawimg = NULL; > > int64_t timestamp = 0; > > + unsigned long duration = 0; > > Why does aom_codec_encode() take an unsigned long as argument for this > when timestamp is int64_t... the ways of AOM are mysterious > > > int res, coded_size; > > aom_enc_frame_flags_t flags = 0; > > > > @@ -1287,6 +1289,8 @@ static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, > > rawimg->stride[AOM_PLANE_U] = frame->linesize[1]; > > rawimg->stride[AOM_PLANE_V] = frame->linesize[2]; > > timestamp = frame->pts; > > + duration = frame->duration ? frame->duration : > > + avctx->ticks_per_frame; > > Extremely unlikely, but on 32bit targets and Win64 this could end up in > a truncated value. I'll add a check. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".