Raise needed score for codec probing in CODEC_ID_PROBE before the last packet.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 11 Apr 2010 00:43:36 +0000 (00:43 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 11 Apr 2010 00:43:36 +0000 (00:43 +0000)
Fixes issue1871

Originally committed as revision 22831 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/utils.c

index eaa9126..20316af 100644 (file)
@@ -675,7 +675,8 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
             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(s, st, pd, 1);
+                //FIXME we dont reduce score to 0 for the case of running out of buffer space in bytes
+                set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);
                 if(st->codec->codec_id != CODEC_ID_PROBE){
                     pd->buf_size=0;
                     av_freep(&pd->buf);