summaryrefslogtreecommitdiff
path: root/libavformat/dss.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-24 14:54:20 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-24 15:41:02 +0100
commit847daac5c0130c190849c90ae34de873e7554478 (patch)
treec0205c4462276ef1b13b9c372dd48439d2ccf1b8 /libavformat/dss.c
parent418be7ceb4717e88b2914a542b68c2c5aba5d677 (diff)
avformat/dss: Set packet position correctly
pos previously was set but then overwritten Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/dss.c')
-rw-r--r--libavformat/dss.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/dss.c b/libavformat/dss.c
index 5ee69a10d6..85cd26a986 100644
--- a/libavformat/dss.c
+++ b/libavformat/dss.c
@@ -211,12 +211,11 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt)
{
DSSDemuxContext *ctx = s->priv_data;
int read_size, ret, offset = 0, buff_offset = 0;
+ int64_t pos = avio_tell(s->pb);
if (ctx->counter == 0)
dss_skip_audio_header(s, pkt);
- pkt->pos = avio_tell(s->pb);
-
if (ctx->swap) {
read_size = DSS_FRAME_SIZE - 2;
buff_offset = 3;
@@ -230,6 +229,7 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
pkt->duration = 0;
+ pkt->pos = pos;
pkt->stream_index = 0;
if (ctx->counter < 0) {
@@ -265,11 +265,11 @@ static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
{
DSSDemuxContext *ctx = s->priv_data;
int size, byte, ret, offset;
+ int64_t pos = avio_tell(s->pb);
if (ctx->counter == 0)
dss_skip_audio_header(s, pkt);
- pkt->pos = avio_tell(s->pb);
/* We make one byte-step here. Don't forget to add offset. */
byte = avio_r8(s->pb);
if (byte == 0xff)
@@ -282,6 +282,7 @@ static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = av_new_packet(pkt, size);
if (ret < 0)
return ret;
+ pkt->pos = pos;
pkt->data[0] = byte;
offset = 1;