summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Manning <tt2468@irltoolkit.com>2023-04-02 16:19:44 -0700
committerTimo Rothenpieler <timo@rothenpieler.org>2023-04-03 12:05:15 +0200
commit00282752165a8d1e252c4a07b262d9384f618759 (patch)
treeefc3f54d95702ee4494bfdd5cf07faca4f45f7fd
parent963937e408fc68b5925f938a253cfff1d506f784 (diff)
downloadffmpeg-00282752165a8d1e252c4a07b262d9384f618759.tar.gz
avcodec/nvenc: fix b-frame DTS behavior with fractional framerates
When using fractional framerates (or any fraction with a numerator != 1), DTS values for packets would be calculated incorrectly. Signed-off-by: Kyle Manning <tt2468@irltoolkit.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
-rw-r--r--libavcodec/nvenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 4450df774c..5d4989861c 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -2032,7 +2032,7 @@ static int nvenc_set_timestamp(AVCodecContext *avctx,
pkt->pts = params->outputTimeStamp;
pkt->dts = timestamp_queue_dequeue(ctx->timestamp_list);
- pkt->dts -= FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1);
+ pkt->dts -= FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1) * FFMAX(avctx->time_base.num, 1);
return 0;
}