aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-05-04 11:50:48 +0200
committerAnton Khirnov <anton@khirnov.net>2023-05-15 10:56:18 +0200
commit7d1d61cc5f57708434ba720b03234b3dd93a4d1e (patch)
tree06bb3e329dcb5d9e1ce9083e6e82ed48f70d1135 /libavcodec/nvenc.c
parent2953ebe7b6925b045e5652420cf07146fbbb17ab (diff)
downloadffmpeg-7d1d61cc5f57708434ba720b03234b3dd93a4d1e.tar.gz
lavc: deprecate AVCodecContext.ticks_per_frame
For encoding, this field is entirely redundant with AVCodecContext.framerate. For decoding, this field is entirely redundant with AV_CODEC_PROP_FIELDS.
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index b2f6253a43..c1798ce564 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1571,7 +1571,13 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
ctx->init_encode_params.frameRateDen = avctx->framerate.den;
} else {
ctx->init_encode_params.frameRateNum = avctx->time_base.den;
- ctx->init_encode_params.frameRateDen = avctx->time_base.num * avctx->ticks_per_frame;
+FF_DISABLE_DEPRECATION_WARNINGS
+ ctx->init_encode_params.frameRateDen = avctx->time_base.num
+#if FF_API_TICKS_PER_FRAME
+ * avctx->ticks_per_frame
+#endif
+ ;
+FF_ENABLE_DEPRECATION_WARNINGS
}
ctx->init_encode_params.enableEncodeAsync = 0;
@@ -2266,8 +2272,14 @@ static int nvenc_set_timestamp(AVCodecContext *avctx,
dts = reorder_queue_dequeue(ctx->reorder_queue, avctx, pkt);
if (avctx->codec_descriptor->props & AV_CODEC_PROP_REORDER) {
+FF_DISABLE_DEPRECATION_WARNINGS
pkt->dts = dts -
- FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1) * FFMAX(avctx->time_base.num, 1);
+ FFMAX(ctx->encode_config.frameIntervalP - 1, 0)
+#if FF_API_TICKS_PER_FRAME
+ * FFMAX(avctx->ticks_per_frame, 1)
+#endif
+ * FFMAX(avctx->time_base.num, 1);
+FF_ENABLE_DEPRECATION_WARNINGS
} else {
pkt->dts = pkt->pts;
}