From 6a67d518d60b61ae2bd98c3948894a7be9955e8c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 7 Jan 2020 14:55:40 +0100 Subject: avformat: Remove unnecessary av_packet_unref() Since bae8844e the packet will always be unreferenced when a demuxer returns an error, so that a lot of calls to av_packet_unref() in lots of demuxers are now redundant and can be removed. Signed-off-by: Andreas Rheinhardt Signed-off-by: Marton Balint --- libavformat/s337m.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'libavformat/s337m.c') diff --git a/libavformat/s337m.c b/libavformat/s337m.c index 8956afb23f..36e1047af8 100644 --- a/libavformat/s337m.c +++ b/libavformat/s337m.c @@ -174,7 +174,6 @@ static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt) pkt->pos = pos; if (avio_read(pb, pkt->data, pkt->size) < pkt->size) { - av_packet_unref(pkt); return AVERROR_EOF; } @@ -186,7 +185,6 @@ static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt) if (!s->nb_streams) { AVStream *st = avformat_new_stream(s, NULL); if (!st) { - av_packet_unref(pkt); return AVERROR(ENOMEM); } st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; -- cgit v1.2.3