History

lavf: add AVFormatContext.max_ts_probe

It allows to configure how long will avformat_find_stream_info() wait to get the first timestamp.

Anton Khirnov committed 12 years ago

Commit b263f8f1 parent 6ca11f75 files · +12 −1Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavformat/avformat.h +6 −0
  3. libavformat/options_table.h +1 −0
  4. libavformat/utils.c +1 −0
  5. libavformat/version.h +1 −1
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2014-08-09 · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16+2014-08-xx - xxxxxxx - lavf 56.03.0 - avformat.h
17+ Add AVFormatContext.max_ts_probe.
18+
1619 2014-08-13 - 8ddc326 - lavu 54.03.0 - mem.h
1720 Add av_strndup().
1821
libavformat/avformat.h+6−0
@@ -1192,6 +1192,12 @@ typedef struct AVFormatContext { · 1191 unmodified lines
11921192 int event_flags;
11931193 #define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata.
11941194
1195+ /**
1196+ * Maximum number of packets to read while waiting for the first timestamp.
1197+ * Decoding only.
1198+ */
1199+ int max_ts_probe;
1200+
11951201 /*****************************************************************
11961202 * All fields below this line are not part of the public API. They
11971203 * may not be used outside of libavformat and can be changed and
libavformat/options_table.h+1−0
@@ -65,6 +65,7 @@ static const AVOption avformat_options[] = { · 64 unmodified lines
6565 {"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"},
6666 {"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"},
6767 {"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 },
6869 {NULL},
6970 };
7071
libavformat/utils.c+1−0
@@ -2108,6 +2108,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 2107 unmodified lines
21082108 !st->codec->extradata)
21092109 break;
21102110 if (st->first_dts == AV_NOPTS_VALUE &&
2111+ st->codec_info_nb_frames < ic->max_ts_probe &&
21112112 (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
21122113 st->codec->codec_type == AVMEDIA_TYPE_AUDIO))
21132114 break;
libavformat/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include "libavutil/version.h"
3131
3232 #define LIBAVFORMAT_VERSION_MAJOR 56
33−#define LIBAVFORMAT_VERSION_MINOR 2
33+#define LIBAVFORMAT_VERSION_MINOR 3
3434 #define LIBAVFORMAT_VERSION_MICRO 0
3535
3636 #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