History

avformat: add av_stream_get_codec_timebase()

This will allow ffmpeg.c to stop using AVStream.codec in some cases

James Almer committed 10 years ago

Commit f0b6f721 parent fd902514 files · +23 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavformat/avformat.h +7 −0
  3. libavformat/utils.c +12 −0
  4. libavformat/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2016-09-27 - xxxxxxx - lavf 57.51.100 - avformat.h
19+ Add av_stream_get_codec_timebase()
20+
1821 2016-09-27 - 23c0779 - lswr 2.2.100 - swresample.h
1922 Add swr_build_matrix().
2023
libavformat/avformat.h+7−0
@@ -2921,6 +2921,13 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, · 2920 unmodified lines
29212921 AVStream *ost, const AVStream *ist,
29222922 enum AVTimebaseSource copy_tb);
29232923
2924+/**
2925+ * Get the internal codec timebase from a stream.
2926+ *
2927+ * @param st input stream to extract the timebase from
2928+ */
2929+AVRational av_stream_get_codec_timebase(const AVStream *st);
2930+
29242931 /**
29252932 * @}
29262933 */
libavformat/utils.c+12−0
@@ -5383,3 +5383,15 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, · 5382 unmodified lines
53835383
53845384 return 0;
53855385 }
5386+
5387+AVRational av_stream_get_codec_timebase(const AVStream *st)
5388+{
5389+ // See avformat_transfer_internal_stream_timing_info() TODO.
5390+#if FF_API_LAVF_AVCTX
5391+FF_DISABLE_DEPRECATION_WARNINGS
5392+ return st->codec->time_base;
5393+FF_ENABLE_DEPRECATION_WARNINGS
5394+#else
5395+ return st->internal->avctx->time_base;
5396+#endif
5397+}
libavformat/version.h+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
3333 // Also please add any ticket numbers that you believe might be affected here
3434 #define LIBAVFORMAT_VERSION_MAJOR 57
35−#define LIBAVFORMAT_VERSION_MINOR 50
35+#define LIBAVFORMAT_VERSION_MINOR 51
3636 #define LIBAVFORMAT_VERSION_MICRO 100
3737
3838 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t