summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-09-27 10:07:14 -0300
committerJames Almer <jamrial@gmail.com>2016-09-27 10:42:39 -0300
commitf0b6f7253f3e69a475722b8f0b0e4289201245bf (patch)
tree2872717b652a56f700dc80bbfc6f721b61ad460e /libavformat/utils.c
parentfd902510ac927c0a252c931f5fb29719a8f56e9c (diff)
downloadffmpeg-f0b6f7253f3e69a475722b8f0b0e4289201245bf.tar.gz
avformat: add av_stream_get_codec_timebase()
This will allow ffmpeg.c to stop using AVStream.codec in some cases Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3e0f57d008..3acb2606f2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5383,3 +5383,15 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
return 0;
}
+
+AVRational av_stream_get_codec_timebase(const AVStream *st)
+{
+ // See avformat_transfer_internal_stream_timing_info() TODO.
+#if FF_API_LAVF_AVCTX
+FF_DISABLE_DEPRECATION_WARNINGS
+ return st->codec->time_base;
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ return st->internal->avctx->time_base;
+#endif
+}