diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-05-26 20:17:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-05-26 20:17:12 +0000 |
commit | 2692067a45e4cb4ce0028e170673f2b2f5039721 (patch) | |
tree | 19b10f28c74700113729a7ae6861c734e8bfab01 /libavformat/westwood.c | |
parent | 4aa606ec179a7df514fe5839b7ab5e24b42145b8 (diff) | |
download | ffmpeg-2692067a45e4cb4ce0028e170673f2b2f5039721.tar.gz |
AVPacket.pos
Originally committed as revision 4314 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/westwood.c')
-rw-r--r-- | libavformat/westwood.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libavformat/westwood.c b/libavformat/westwood.c index 6fcb39ea71..22150e2a64 100644 --- a/libavformat/westwood.c +++ b/libavformat/westwood.c @@ -170,15 +170,12 @@ static int wsaud_read_packet(AVFormatContext *s, return AVERROR_INVALIDDATA; chunk_size = LE_16(&preamble[0]); - if (av_new_packet(pkt, chunk_size)) + ret= av_get_packet(pb, pkt, chunk_size); + if (ret != chunk_size) return AVERROR_IO; pkt->stream_index = wsaud->audio_stream_index; pkt->pts = wsaud->audio_frame_counter; pkt->pts /= wsaud->audio_samplerate; - if ((ret = get_buffer(pb, pkt->data, chunk_size)) != chunk_size) { - av_free_packet(pkt); - ret = AVERROR_IO; - } /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */ wsaud->audio_frame_counter += (chunk_size * 2) / wsaud->audio_channels; @@ -322,11 +319,8 @@ static int wsvqa_read_packet(AVFormatContext *s, if ((chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) { - if (av_new_packet(pkt, chunk_size)) - return AVERROR_IO; - ret = get_buffer(pb, pkt->data, chunk_size); + av_get_packet(pb, pkt, chunk_size); if (ret != chunk_size) { - av_free_packet(pkt); ret = AVERROR_IO; } |