It allows to configure how long will avformat_find_stream_info() wait to get the first timestamp.
Unified · Split
| @@ -13,6 +13,9 @@ libavutil: 2014-08-09 · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2014-08-xx - xxxxxxx - lavf 56.03.0 - avformat.h | |
| 17 | + Add AVFormatContext.max_ts_probe. | |
| 18 | + | |
| 16 | 19 | 2014-08-13 - 8ddc326 - lavu 54.03.0 - mem.h |
| 17 | 20 | Add av_strndup(). |
| 18 | 21 | |
| @@ -1192,6 +1192,12 @@ typedef struct AVFormatContext { · 1191 unmodified lines | ||
| 1192 | 1192 | int event_flags; |
| 1193 | 1193 | #define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata. |
| 1194 | 1194 | |
| 1195 | + /** | |
| 1196 | + * Maximum number of packets to read while waiting for the first timestamp. | |
| 1197 | + * Decoding only. | |
| 1198 | + */ | |
| 1199 | + int max_ts_probe; | |
| 1200 | + | |
| 1195 | 1201 | /***************************************************************** |
| 1196 | 1202 | * All fields below this line are not part of the public API. They |
| 1197 | 1203 | * may not be used outside of libavformat and can be changed and |
| @@ -65,6 +65,7 @@ static const AVOption avformat_options[] = { · 64 unmodified lines | ||
| 65 | 65 | {"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, D|E, "strict"}, |
| 66 | 66 | {"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"}, |
| 67 | 67 | {"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"}, |
| 68 | +{"max_ts_probe", "maximum number of packets to read while waiting for the first timestamp", OFFSET(max_ts_probe), AV_OPT_TYPE_INT, { .i64 = 50 }, 0, INT_MAX, D }, | |
| 68 | 69 | {NULL}, |
| 69 | 70 | }; |
| 70 | 71 | |
| @@ -2108,6 +2108,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 2107 unmodified lines | ||
| 2108 | 2108 | !st->codec->extradata) |
| 2109 | 2109 | break; |
| 2110 | 2110 | if (st->first_dts == AV_NOPTS_VALUE && |
| 2111 | + st->codec_info_nb_frames < ic->max_ts_probe && | |
| 2111 | 2112 | (st->codec->codec_type == AVMEDIA_TYPE_VIDEO || |
| 2112 | 2113 | st->codec->codec_type == AVMEDIA_TYPE_AUDIO)) |
| 2113 | 2114 | break; |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include "libavutil/version.h" |
| 31 | 31 | |
| 32 | 32 | #define LIBAVFORMAT_VERSION_MAJOR 56 |
| 33 | −#define LIBAVFORMAT_VERSION_MINOR 2 | |
| 33 | +#define LIBAVFORMAT_VERSION_MINOR 3 | |
| 34 | 34 | #define LIBAVFORMAT_VERSION_MICRO 0 |
| 35 | 35 | |
| 36 | 36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |