aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-05-26 20:17:12 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-05-26 20:17:12 +0000
commit2692067a45e4cb4ce0028e170673f2b2f5039721 (patch)
tree19b10f28c74700113729a7ae6861c734e8bfab01 /libavformat/4xm.c
parent4aa606ec179a7df514fe5839b7ab5e24b42145b8 (diff)
downloadffmpeg-2692067a45e4cb4ce0028e170673f2b2f5039721.tar.gz
AVPacket.pos
Originally committed as revision 4314 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 5ce1f43f5e..7c0f78e6b9 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -277,6 +277,7 @@ static int fourxm_read_packet(AVFormatContext *s,
return AVERROR_IO;
pkt->stream_index = fourxm->video_stream_index;
pkt->pts = fourxm->video_pts;
+ pkt->pos = url_ftell(&s->pb);
memcpy(pkt->data, header, 8);
ret = get_buffer(&s->pb, &pkt->data[8], size);
@@ -293,16 +294,13 @@ static int fourxm_read_packet(AVFormatContext *s,
size-=8;
if (track_number == fourxm->selected_track) {
- if (av_new_packet(pkt, size))
+ ret= av_get_packet(&s->pb, pkt, size);
+ if(ret<0)
return AVERROR_IO;
pkt->stream_index =
fourxm->tracks[fourxm->selected_track].stream_index;
pkt->pts = fourxm->audio_pts;
- ret = get_buffer(&s->pb, pkt->data, size);
- if (ret < 0)
- av_free_packet(pkt);
- else
- packet_read = 1;
+ packet_read = 1;
/* pts accounting */
audio_frame_count = size;