Mercurial > libavformat.hg
comparison utils.c @ 3572:3f345a61cef0 libavformat
Only try to probe the codec when the available data has roughly doubled
relative to the last attempt.
author | michael |
---|---|
date | Sat, 12 Jul 2008 19:57:30 +0000 |
parents | fe242597b6e4 |
children | 9afe7cc51c3f |
comparison
equal
deleted
inserted
replaced
3571:fe242597b6e4 | 3572:3f345a61cef0 |
---|---|
586 pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE); | 586 pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE); |
587 memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size); | 587 memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size); |
588 pd->buf_size += pkt->size; | 588 pd->buf_size += pkt->size; |
589 memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE); | 589 memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE); |
590 | 590 |
591 if(av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)){ | |
591 set_codec_from_probe_data(st, pd, 1); | 592 set_codec_from_probe_data(st, pd, 1); |
592 if(st->codec->codec_id != CODEC_ID_PROBE){ | 593 if(st->codec->codec_id != CODEC_ID_PROBE){ |
593 pd->buf_size=0; | 594 pd->buf_size=0; |
594 av_freep(&pd->buf); | 595 av_freep(&pd->buf); |
596 } | |
595 } | 597 } |
596 } | 598 } |
597 } | 599 } |
598 } | 600 } |
599 | 601 |