1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/adp, svs: Remove redundant av_shrink_packet()

av_get_packet() already makes sure that the packet size is accurate
and that the packet data is zero-padded even when one could not read as
much as desired.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2021-03-12 09:23:46 +01:00
parent 51367267c8
commit d025a5bcc2
2 changed files with 2 additions and 7 deletions

View File

@ -75,13 +75,9 @@ static int adp_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, size);
if (ret < 0)
return ret;
if (ret != size) {
if (ret < 0) {
return ret;
}
av_shrink_packet(pkt, ret);
}
pkt->stream_index = 0;
return ret;

View File

@ -79,7 +79,6 @@ static int svs_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret != 32 * 256) {
if (ret < 0)
return ret;
av_shrink_packet(pkt, ret);
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
}
pkt->stream_index = 0;