summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.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
commita172b33ebf19f91fcb9daf854af56af2e5fbbada (patch)
tree833acb1f1bff3b08460875416bbcdff0dcba2c1d /libavcodec/libx264.c
parent782127d876f52400e61f78536ae759c2f3775528 (diff)
downloadffmpeg-a172b33ebf19f91fcb9daf854af56af2e5fbbada.tar.gz
lavc/libx264: pass through frame durations to encoded packets
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 6d22a1726e..2742fb11a0 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -52,6 +52,7 @@
typedef struct X264Opaque {
int64_t reordered_opaque;
int64_t wallclock;
+ int64_t duration;
void *frame_opaque;
AVBufferRef *frame_opaque_ref;
@@ -459,6 +460,7 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame,
}
opaque->reordered_opaque = frame->reordered_opaque;
+ opaque->duration = frame->duration;
opaque->wallclock = wallclock;
if (ctx->export_side_data & AV_CODEC_EXPORT_DATA_PRFT)
opaque->wallclock = av_gettime();
@@ -612,6 +614,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
out_opaque < &x4->reordered_opaque[x4->nb_reordered_opaque]) {
ctx->reordered_opaque = out_opaque->reordered_opaque;
wallclock = out_opaque->wallclock;
+ pkt->duration = out_opaque->duration;
if (ctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
pkt->opaque = out_opaque->frame_opaque;