summaryrefslogtreecommitdiff
path: root/libavformat
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 /libavformat
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 'libavformat')
-rw-r--r--libavformat/avformat.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index fea905693d..356b4de931 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -710,7 +710,6 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
AVRational dec_ctx_tb = dec_ctx->framerate.num ? av_inv_q(av_mul_q(dec_ctx->framerate, mul))
: (ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO ? (AVRational){0, 1}
: ist->time_base);
-
enc_ctx->time_base = ist->time_base;
/*
* Avi is a special case here because it supports variable fps but
@@ -727,7 +726,11 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
|| copy_tb == AVFMT_TBCF_R_FRAMERATE) {
enc_ctx->time_base.num = ist->r_frame_rate.den;
enc_ctx->time_base.den = 2*ist->r_frame_rate.num;
+#if FF_API_TICKS_PER_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
enc_ctx->ticks_per_frame = 2;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
} else
#endif
if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->framerate.num &&
@@ -736,9 +739,13 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
|| (copy_tb == AVFMT_TBCF_DECODER &&
(dec_ctx->framerate.num || ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))) {
enc_ctx->time_base = dec_ctx_tb;
- enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
enc_ctx->time_base.den *= 2;
+#if FF_API_TICKS_PER_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
enc_ctx->ticks_per_frame = 2;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
} else if (!(ofmt->flags & AVFMT_VARIABLE_FPS)
&& !av_match_name(ofmt->name, "mov,mp4,3gp,3g2,psp,ipod,ismv,f4v")) {
@@ -748,7 +755,11 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
|| (copy_tb == AVFMT_TBCF_DECODER &&
(dec_ctx->framerate.num || ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))) {
enc_ctx->time_base = dec_ctx_tb;
+#if FF_API_TICKS_PER_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
}