aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2020-05-01 20:51:26 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2020-05-01 21:00:40 +0200
commita59b535af4df396fcad41eea3462b206e6ef3fbc (patch)
tree6b495052a0ed1e2b2ff0dbe0ce4f4eae86b1972d /libavcodec
parentd1e8be34114d5782a5a4ea79ef0b9e92b6b37bc7 (diff)
downloadffmpeg-a59b535af4df396fcad41eea3462b206e6ef3fbc.tar.gz
avcodec/nvenc: offset dts to account for b-frame reordering
Fixes ticket #7303 Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/nvenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index fb13dfc3a5..38095e7fa1 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1783,10 +1783,11 @@ static int nvenc_set_timestamp(AVCodecContext *avctx,
pkt->dts = ts0 - delta;
ctx->first_packet_output = 1;
- return 0;
+ } else {
+ pkt->dts = timestamp_queue_dequeue(ctx->timestamp_list);
}
- pkt->dts = timestamp_queue_dequeue(ctx->timestamp_list);
+ pkt->dts -= avctx->max_b_frames;
return 0;
}