diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-27 23:09:38 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-25 23:54:34 +0200 |
commit | c37d17929590d318bc44f59d86a184e7e76def2b (patch) | |
tree | 763a92801082546e928560dad40b2235b4d0e1bd /libavformat/utils.c | |
parent | b0d0e29ffbd42f9feb358718cfe6a90608b69ecf (diff) | |
download | ffmpeg-c37d17929590d318bc44f59d86a184e7e76def2b.tar.gz |
avformat: add format_probesize to allow tuning the maximum amount of bytes to identify the filetype
Currently probesize is cliped at 1mb before being used for format detection.
Alternatively this cliping could be removed but this would then tie various
things like stream analysis to the file detection.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 7e3ec9b859..c9a3d4db1e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -379,8 +379,6 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, if (!max_probe_size) max_probe_size = PROBE_BUF_MAX; - else if (max_probe_size > PROBE_BUF_MAX) - max_probe_size = PROBE_BUF_MAX; else if (max_probe_size < PROBE_BUF_MIN) { av_log(logctx, AV_LOG_ERROR, "Specified probe size value %u cannot be < %u\n", max_probe_size, PROBE_BUF_MIN); @@ -474,7 +472,7 @@ static int init_input(AVFormatContext *s, const char *filename, s->flags |= AVFMT_FLAG_CUSTOM_IO; if (!s->iformat) return av_probe_input_buffer2(s->pb, &s->iformat, filename, - s, 0, s->probesize); + s, 0, s->format_probesize); else if (s->iformat->flags & AVFMT_NOFILE) av_log(s, AV_LOG_WARNING, "Custom AVIOContext makes no sense and " "will be ignored with AVFMT_NOFILE format.\n"); @@ -491,7 +489,7 @@ static int init_input(AVFormatContext *s, const char *filename, if (s->iformat) return 0; return av_probe_input_buffer2(s->pb, &s->iformat, filename, - s, 0, s->probesize); + s, 0, s->format_probesize); } static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt, |