aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libx265.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-07-12 14:37:15 +0200
committerAnton Khirnov <anton@khirnov.net>2023-01-29 09:23:17 +0100
commitd87055107d80dac898e5b2f58711e1958cbd8eb2 (patch)
treeb380a9c1576229cf3d021b7ba6e9d599452d57e8 /libavcodec/libx265.c
parenta172b33ebf19f91fcb9daf854af56af2e5fbbada (diff)
downloadffmpeg-d87055107d80dac898e5b2f58711e1958cbd8eb2.tar.gz
lavc/libx265: pass through frame durations to encoded packets
Diffstat (limited to 'libavcodec/libx265.c')
-rw-r--r--libavcodec/libx265.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index a71f1f76d3..6fc189f1b5 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;
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
rd->frame_opaque = pic->opaque;
@@ -755,6 +757,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;