Commit fe63d413 authored by Paul B Mahol's avatar Paul B Mahol

brstm: do not return partial packets

Such packets are useless.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 857d7194
...@@ -266,19 +266,18 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -266,19 +266,18 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
(b->current_block - 1), 4 * codec->channels); (b->current_block - 1), 4 * codec->channels);
ret = avio_read(s->pb, dst, size); ret = avio_read(s->pb, dst, size);
if (ret < 0) { if (ret != size)
av_free_packet(pkt); av_free_packet(pkt);
return ret;
}
pkt->duration = samples; pkt->duration = samples;
} else { } else {
ret = av_get_packet(s->pb, pkt, size); ret = av_get_packet(s->pb, pkt, size);
if (ret < 0)
return ret;
} }
pkt->stream_index = 0; pkt->stream_index = 0;
if (ret != size)
ret = AVERROR(EIO);
return ret; return ret;
} }
......
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