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
This commit is contained in:
@@ -588,11 +588,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
pd->buf_size += pkt->size;
|
pd->buf_size += pkt->size;
|
||||||
memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_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);
|
set_codec_from_probe_data(st, pd, 1);
|
||||||
if(st->codec->codec_id != CODEC_ID_PROBE){
|
if(st->codec->codec_id != CODEC_ID_PROBE){
|
||||||
pd->buf_size=0;
|
pd->buf_size=0;
|
||||||
av_freep(&pd->buf);
|
av_freep(&pd->buf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user