Commit c6e72ca6 authored by reimar's avatar reimar

Set pkt->pos correctly (to the start of header of the packet) in swfdec.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17953 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 195a04c4
...@@ -87,6 +87,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -87,6 +87,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
int tag, len, i, frame, v; int tag, len, i, frame, v;
for(;;) { for(;;) {
uint64_t pos = url_ftell(pb);
tag = get_swf_tag(pb, &len); tag = get_swf_tag(pb, &len);
if (tag < 0) if (tag < 0)
return AVERROR(EIO); return AVERROR(EIO);
...@@ -148,6 +149,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -148,6 +149,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) { if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) {
frame = get_le16(pb); frame = get_le16(pb);
av_get_packet(pb, pkt, len-2); av_get_packet(pb, pkt, len-2);
pkt->pos = pos;
pkt->pts = frame; pkt->pts = frame;
pkt->stream_index = st->index; pkt->stream_index = st->index;
return pkt->size; return pkt->size;
...@@ -163,6 +165,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -163,6 +165,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
} else { // ADPCM, PCM } else { // ADPCM, PCM
av_get_packet(pb, pkt, len); av_get_packet(pb, pkt, len);
} }
pkt->pos = pos;
pkt->stream_index = st->index; pkt->stream_index = st->index;
return pkt->size; return pkt->size;
} }
...@@ -195,6 +198,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -195,6 +198,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
} else { } else {
get_buffer(pb, pkt->data + 4, pkt->size - 4); get_buffer(pb, pkt->data + 4, pkt->size - 4);
} }
pkt->pos = pos;
pkt->stream_index = st->index; pkt->stream_index = st->index;
return pkt->size; return pkt->size;
} }
......
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