summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-07-12 14:37:15 +0200
committerAnton Khirnov <anton@khirnov.net>2022-11-28 10:34:10 +0100
commite9ef5471a4d1f7cab9789fce125b83e70aea942f (patch)
tree4b9428aa6f05605efef60684288a3b1633a53674
parent65597fd31373ddd35a8070723af364fb6ad4e873 (diff)
lavc/libx265: pass through frame durations to encoded packets
-rw-r--r--libavcodec/libx265.c3
1 files changed, 3 insertions, 0 deletions
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;