mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/dss: Set packet position correctly
pos previously was set but then overwritten Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
418be7ceb4
commit
847daac5c0
|
@ -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)
|
||||||
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)
|
||||||
{
|
{
|
||||||
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)
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue