Commit f9329946 authored by Michael Niedermayer's avatar Michael Niedermayer

Parse fact chunks from wav files to find duration.

Originally committed as revision 26370 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 724b1f6a
...@@ -232,7 +232,18 @@ static int wav_read_header(AVFormatContext *s, ...@@ -232,7 +232,18 @@ static int wav_read_header(AVFormatContext *s,
av_set_pts_info(st, 64, 1, st->codec->sample_rate); av_set_pts_info(st, 64, 1, st->codec->sample_rate);
size = find_tag(pb, MKTAG('d', 'a', 't', 'a')); for (;;) {
if (url_feof(pb))
return -1;
size = next_tag(pb, &tag);
if (tag == MKTAG('d', 'a', 't', 'a')){
break;
}else if (tag == MKTAG('f','a','c','t') && !sample_count){
sample_count = get_le32(pb);
size -= 4;
}
url_fseek(pb, size, SEEK_CUR);
}
if (rf64) if (rf64)
size = data_size; size = data_size;
if (size < 0) if (size < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment