aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
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:10:22 +0200
commitf6facaf8c9e33472fc0be8ba5cd9666f7b0ff32d (patch)
treed11df8368442a2f57921f1fe81cee7492108a1df /libavcodec
parent0e15444aceca0e78f99f3d67758eb79d11b86599 (diff)
downloadffmpeg-f6facaf8c9e33472fc0be8ba5cd9666f7b0ff32d.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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/nvenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 9386aadae2..507ca4f666 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -2022,7 +2022,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;
}