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
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162014-08-xx - xxxxxxx - lavf 56.03.0 - avformat.h
17 Add AVFormatContext.max_ts_probe.
18
162014-08-13 - 8ddc326 - lavu 54.03.0 - mem.h192014-08-13 - 8ddc326 - lavu 54.03.0 - mem.h
17 Add av_strndup().20 Add av_strndup().
18 21
libavformat/avformat.h+6−0
@@ -1192,6 +1192,12 @@ typedef struct AVFormatContext { · 1191 unmodified lines
1192 int event_flags;1192 int event_flags;
1193#define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata.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 * All fields below this line are not part of the public API. They1202 * All fields below this line are not part of the public API. They
1197 * may not be used outside of libavformat and can be changed and1203 * 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
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"},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{"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"},66{"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"},
67{"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"},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{NULL},69{NULL},
69};70};
70 71
libavformat/utils.c+1−0
@@ -2108,6 +2108,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 2107 unmodified lines
2108 !st->codec->extradata)2108 !st->codec->extradata)
2109 break;2109 break;
2110 if (st->first_dts == AV_NOPTS_VALUE &&2110 if (st->first_dts == AV_NOPTS_VALUE &&
2111 st->codec_info_nb_frames < ic->max_ts_probe &&
2111 (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||2112 (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
2112 st->codec->codec_type == AVMEDIA_TYPE_AUDIO))2113 st->codec->codec_type == AVMEDIA_TYPE_AUDIO))
2113 break;2114 break;
libavformat/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include "libavutil/version.h"30#include "libavutil/version.h"
31 31
32#define LIBAVFORMAT_VERSION_MAJOR 5632#define LIBAVFORMAT_VERSION_MAJOR 56
33#define LIBAVFORMAT_VERSION_MINOR 233#define LIBAVFORMAT_VERSION_MINOR 3
34#define LIBAVFORMAT_VERSION_MICRO 034#define LIBAVFORMAT_VERSION_MICRO 0
35 35
36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \36#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