diff options
author | Andriy Gelman <andriy.gelman@gmail.com> | 2019-10-17 10:49:20 -0400 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-03 11:52:32 +0100 |
commit | 5e3229df4ca86322f334bd098a9335f66ebdd649 (patch) | |
tree | 323d2b60daf824630cc304635746b1983f47268f /libavformat/utils.c | |
parent | 33583803e107b6d532def0f9d949364b01b6ad5a (diff) | |
download | ffmpeg-5e3229df4ca86322f334bd098a9335f66ebdd649.tar.gz |
avformat: Add max_probe_packets option
Allows user to set maximum number of buffered packets when
probing a codec. It was a hard-coded parameter before this commit.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index cfb6d03397..8196442dd1 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -363,7 +363,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, int i; av_log(s, AV_LOG_DEBUG, "Probe with size=%d, packets=%d detected %s with score=%d\n", - pd->buf_size, MAX_PROBE_PACKETS - st->probe_packets, + pd->buf_size, s->max_probe_packets - st->probe_packets, fmt->name, score); for (i = 0; fmt_id_type[i].name; i++) { if (!strcmp(fmt->name, fmt_id_type[i].name)) { @@ -1948,7 +1948,7 @@ void ff_read_frame_flush(AVFormatContext *s) /* We set the current DTS to an unspecified origin. */ st->cur_dts = AV_NOPTS_VALUE; - st->probe_packets = MAX_PROBE_PACKETS; + st->probe_packets = s->max_probe_packets; for (j = 0; j < MAX_REORDER_DELAY + 1; j++) st->pts_buffer[j] = AV_NOPTS_VALUE; @@ -4570,7 +4570,7 @@ FF_ENABLE_DEPRECATION_WARNINGS st->start_time = AV_NOPTS_VALUE; st->duration = AV_NOPTS_VALUE; st->first_dts = AV_NOPTS_VALUE; - st->probe_packets = MAX_PROBE_PACKETS; + st->probe_packets = s->max_probe_packets; st->pts_wrap_reference = AV_NOPTS_VALUE; st->pts_wrap_behavior = AV_PTS_WRAP_IGNORE; |