Browse Source

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>
tags/n4.4
Andreas Rheinhardt 5 years ago
parent
commit
d025a5bcc2
2 changed files with 2 additions and 7 deletions
  1. +2
    -6
      libavformat/adp.c
  2. +0
    -1
      libavformat/svs.c

+ 2
- 6
libavformat/adp.c 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;


+ 0
- 1
libavformat/svs.c 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;


Loading…
Cancel
Save