[FFmpeg-cvslog] avcodec/nvenc: offset dts to account for b-frame reordering
Timo Rothenpieler
git at videolan.org
Fri May 1 22:01:03 EEST 2020
ffmpeg | branch: release/4.2 | Timo Rothenpieler <timo at rothenpieler.org> | Fri May 1 20:51:26 2020 +0200| [a59b535af4df396fcad41eea3462b206e6ef3fbc] | committer: Timo Rothenpieler
avcodec/nvenc: offset dts to account for b-frame reordering
Fixes ticket #7303
Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a59b535af4df396fcad41eea3462b206e6ef3fbc
---
libavcodec/nvenc.c | 5 +++--
1 file 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;
}
More information about the ffmpeg-cvslog
mailing list