diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-25 12:27:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-25 13:25:09 +0200 |
commit | 215db2935b06c0e936dadce012a31de7da25ba97 (patch) | |
tree | 6ba41973c6902ce6e18d9cfa31330ab5fa290da2 | |
parent | f1b04f803eafa17dbfa19977b1a76f412183478e (diff) | |
parent | b263f8ffe7599d9cd27ec477a12700da8eb2790d (diff) | |
download | ffmpeg-215db2935b06c0e936dadce012a31de7da25ba97.tar.gz |
Merge commit 'b263f8ffe7599d9cd27ec477a12700da8eb2790d'
* commit 'b263f8ffe7599d9cd27ec477a12700da8eb2790d':
lavf: add AVFormatContext.max_ts_probe
Conflicts:
doc/APIchanges
libavformat/avformat.h
libavformat/utils.c
libavformat/version.h
lavf-fate/mp3 changes as the estimated input bitrate changes and that is
copied to the output
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavformat/avformat.h | 6 | ||||
-rw-r--r-- | libavformat/options_table.h | 1 | ||||
-rw-r--r-- | libavformat/utils.c | 1 | ||||
-rw-r--r-- | libavformat/version.h | 2 | ||||
-rw-r--r-- | tests/ref/lavf-fate/mp3 | 4 |
6 files changed, 14 insertions, 3 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index de4040db8f..58be3cb9b8 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2014-08-09 API changes, most recent first: +2014-08-xx - xxxxxxx - lavf 56.03.0 - avformat.h + Add AVFormatContext.max_ts_probe. + 2014-08-23 - xxxxxxx - lavu 54.7.100 - dict.h AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL arguments are now freed even on error. This is consistent with the behaviour all users diff --git a/libavformat/avformat.h b/libavformat/avformat.h index f6fb5a36a5..b915148ad7 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1454,6 +1454,12 @@ typedef struct AVFormatContext { int event_flags; #define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata. + /** + * Maximum number of packets to read while waiting for the first timestamp. + * Decoding only. + */ + int max_ts_probe; + /** * Transport stream id. diff --git a/libavformat/options_table.h b/libavformat/options_table.h index 94cd65cb59..eb4115cd7b 100644 --- a/libavformat/options_table.h +++ b/libavformat/options_table.h @@ -94,6 +94,7 @@ static const AVOption avformat_options[] = { {"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"}, {"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"}, {"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"}, +{"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 }, {NULL}, }; diff --git a/libavformat/utils.c b/libavformat/utils.c index b4ca342898..14896cc49c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3064,6 +3064,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) break; if (st->first_dts == AV_NOPTS_VALUE && !(ic->iformat->flags & AVFMT_NOTIMESTAMPS) && + st->codec_info_nb_frames < ic->max_ts_probe && (st->codec->codec_type == AVMEDIA_TYPE_VIDEO || st->codec->codec_type == AVMEDIA_TYPE_AUDIO)) break; diff --git a/libavformat/version.h b/libavformat/version.h index 8b8a690136..b802bbbaa8 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 56 -#define LIBAVFORMAT_VERSION_MINOR 2 +#define LIBAVFORMAT_VERSION_MINOR 3 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ diff --git a/tests/ref/lavf-fate/mp3 b/tests/ref/lavf-fate/mp3 index 6f201e00fe..ec6665261d 100644 --- a/tests/ref/lavf-fate/mp3 +++ b/tests/ref/lavf-fate/mp3 @@ -1,3 +1,3 @@ -6bdea919dc6856d76ef2553698e2b0d3 *./tests/data/lavf-fate/lavf.mp3 -96376 ./tests/data/lavf-fate/lavf.mp3 +8facd3cc6158b611cb312920a426cbd7 *./tests/data/lavf-fate/lavf.mp3 +96016 ./tests/data/lavf-fate/lavf.mp3 ./tests/data/lavf-fate/lavf.mp3 CRC=0x6c9850fe |