[FFmpeg-cvslog] avformat/utils: fix av_probe_input_buffer2() so it returns the probe score
Michael Niedermayer
git at videolan.org
Tue Feb 4 05:34:54 CET 2014
ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Thu Aug 29 01:07:57 2013 +0200| [c06f8bac204a2c8274533f183ad61d2a985f693d] | committer: Michael Niedermayer
avformat/utils: fix av_probe_input_buffer2() so it returns the probe score
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c4810fbe4f53d312ba70f251f7ee4f484cbca565)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c06f8bac204a2c8274533f183ad61d2a985f693d
---
libavformat/utils.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1be62f1..89bc141 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -436,6 +436,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
unsigned char *buf = NULL;
uint8_t *mime_type;
int ret = 0, probe_size, buf_offset = 0;
+ int score = 0;
if (!max_probe_size) {
max_probe_size = PROBE_BUF_MAX;
@@ -458,12 +459,12 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
for(probe_size= PROBE_BUF_MIN; probe_size<=max_probe_size && !*fmt;
probe_size = FFMIN(probe_size<<1, FFMAX(max_probe_size, probe_size+1))) {
- int score = probe_size < max_probe_size ? AVPROBE_SCORE_RETRY : 0;
void *buftmp;
if (probe_size < offset) {
continue;
}
+ score = probe_size < max_probe_size ? AVPROBE_SCORE_RETRY : 0;
/* read probe data */
buftmp = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE);
@@ -504,7 +505,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
/* rewind. reuse probe buffer to avoid seeking */
ret = ffio_rewind_with_probe_data(pb, &buf, pd.buf_size);
- return ret;
+ return ret < 0 ? ret : score;
}
/* open input file and probe the format if necessary */
More information about the ffmpeg-cvslog
mailing list