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) ...@@ -211,12 +211,11 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt)
{ {
DSSDemuxContext *ctx = s->priv_data; DSSDemuxContext *ctx = s->priv_data;
int read_size, ret, offset = 0, buff_offset = 0; int read_size, ret, offset = 0, buff_offset = 0;
int64_t pos = avio_tell(s->pb);
if (ctx->counter == 0) if (ctx->counter == 0)
dss_skip_audio_header(s, pkt); dss_skip_audio_header(s, pkt);
pkt->pos = avio_tell(s->pb);
if (ctx->swap) { if (ctx->swap) {
read_size = DSS_FRAME_SIZE - 2; read_size = DSS_FRAME_SIZE - 2;
buff_offset = 3; buff_offset = 3;
...@@ -230,6 +229,7 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -230,6 +229,7 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret; return ret;
pkt->duration = 0; pkt->duration = 0;
pkt->pos = pos;
pkt->stream_index = 0; pkt->stream_index = 0;
if (ctx->counter < 0) { if (ctx->counter < 0) {
...@@ -265,11 +265,11 @@ static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -265,11 +265,11 @@ static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
{ {
DSSDemuxContext *ctx = s->priv_data; DSSDemuxContext *ctx = s->priv_data;
int size, byte, ret, offset; int size, byte, ret, offset;
int64_t pos = avio_tell(s->pb);
if (ctx->counter == 0) if (ctx->counter == 0)
dss_skip_audio_header(s, pkt); dss_skip_audio_header(s, pkt);
pkt->pos = avio_tell(s->pb);
/* We make one byte-step here. Don't forget to add offset. */ /* We make one byte-step here. Don't forget to add offset. */
byte = avio_r8(s->pb); byte = avio_r8(s->pb);
if (byte == 0xff) if (byte == 0xff)
...@@ -282,6 +282,7 @@ static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -282,6 +282,7 @@ static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = av_new_packet(pkt, size); ret = av_new_packet(pkt, size);
if (ret < 0) if (ret < 0)
return ret; return ret;
pkt->pos = pos;
pkt->data[0] = byte; pkt->data[0] = byte;
offset = 1; 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