Commit 847daac5 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/dss: Set packet position correctly

pos previously was set but then overwritten
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 418be7ce
......@@ -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;
......
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