summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.c
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 20:52:36 +0200
commitaaadf0dce8fa7b3b5073089498a84e758ceb975a (patch)
treefb7583b37f2b116833de7ec553b2cfd03690c3c1 /libavcodec/nvenc.c
parentd69576294939247d3a0c0904425c219047053421 (diff)
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/nvenc.c')
-rw-r--r--libavcodec/nvenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 2c75399b44..4894c9e909 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1838,10 +1838,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;
}