summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2008-07-12 19:57:30 +0000
committerMichael Niedermayer <[email protected]>2008-07-12 19:57:30 +0000
commit942de2f4faf17f5b49d8c91af2234c365244d99c (patch)
tree649bedc3d843c936f5fbcbb204c0fffeed68e21f
parent312d24d5e9b94a8c4363d3830ab328022064f19d (diff)
Only try to probe the codec when the available data has roughly doubled
relative to the last attempt. Originally committed as revision 14188 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9f573d61c5..4c38aaf3ed 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -588,11 +588,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
pd->buf_size += pkt->size;
memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);
+ if(av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)){
set_codec_from_probe_data(st, pd, 1);
if(st->codec->codec_id != CODEC_ID_PROBE){
pd->buf_size=0;
av_freep(&pd->buf);
}
+ }
}
}
}