diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-02-05 23:04:48 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-02-05 23:04:48 +0000 |
commit | e9b78eeba22b050810a507e69df1b652e56ab62b (patch) | |
tree | c63d266eb46b8f7d8a8c98e7ed39bd426aa48be8 /libavformat/wav.c | |
parent | 7ee829922b1053a2496e5f0849265c4cb9060baf (diff) | |
download | ffmpeg-e9b78eeba22b050810a507e69df1b652e56ab62b.tar.gz |
better generic index building and seeking code
Originally committed as revision 7841 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/wav.c')
-rw-r--r-- | libavformat/wav.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/wav.c b/libavformat/wav.c index f3ede5185b..3a959a8aa6 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -188,13 +188,11 @@ static int wav_read_packet(AVFormatContext *s, size = (size / st->codec->block_align) * st->codec->block_align; } size= FFMIN(size, left); - if (av_new_packet(pkt, size)) + ret= av_get_packet(&s->pb, pkt, size); + if (ret <= 0) return AVERROR_IO; pkt->stream_index = 0; - ret = get_buffer(&s->pb, pkt->data, pkt->size); - if (ret < 0) - av_free_packet(pkt); /* note: we need to modify the packet size here to handle the last packet */ pkt->size = ret; @@ -235,6 +233,7 @@ AVInputFormat wav_demuxer = { wav_read_packet, wav_read_close, wav_read_seek, + .flags= AVFMT_GENERIC_INDEX, .codec_tag= (const AVCodecTag*[]){codec_wav_tags, 0}, }; #endif |