[FFmpeg-cvslog] avformat: add av_stream_get_codec_timebase()

James Almer git at videolan.org
Tue Sep 27 16:45:22 EEST 2016


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Sep 27 10:07:14 2016 -0300| [f0b6f7253f3e69a475722b8f0b0e4289201245bf] | committer: James Almer

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0b6f7253f3e69a475722b8f0b0e4289201245bf
---

 doc/APIchanges         |  3 +++
 libavformat/avformat.h |  7 +++++++
 libavformat/utils.c    | 12 ++++++++++++
 libavformat/version.h  |  2 +-
 4 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index b5072cf..e4a96cc 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2015-08-28
 
 API changes, most recent first:
 
+2016-09-27 - xxxxxxx - lavf 57.51.100 - avformat.h
+  Add av_stream_get_codec_timebase()
+
 2016-09-27 - 23c0779 - lswr 2.2.100 - swresample.h
   Add swr_build_matrix().
 
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index ae70cc8..057f8c5 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2922,6 +2922,13 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
                                                   enum AVTimebaseSource copy_tb);
 
 /**
+ * Get the internal codec timebase from a stream.
+ *
+ * @param st  input stream to extract the timebase from
+ */
+AVRational av_stream_get_codec_timebase(const AVStream *st);
+
+/**
  * @}
  */
 
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3e0f57d..3acb260 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
+}
diff --git a/libavformat/version.h b/libavformat/version.h
index 1bdf3f2..b0b5593 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  50
+#define LIBAVFORMAT_VERSION_MINOR  51
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list