From a5d42043093a39636a1f4021a37dd9c612479f6f Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 23 Oct 2015 11:11:30 +0200 Subject: avformat: Always return ref-counted AVPacket And drop the av_dup_packet from the input_thread. --- libavformat/utils.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libavformat/utils.c') diff --git a/libavformat/utils.c b/libavformat/utils.c index f8926bdc64..fd96b9d959 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -413,6 +413,14 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) continue; } + if (!pkt->buf) { + AVPacket tmp = { 0 }; + ret = av_packet_ref(&tmp, pkt); + if (ret < 0) + return ret; + *pkt = tmp; + } + if ((s->flags & AVFMT_FLAG_DISCARD_CORRUPT) && (pkt->flags & AV_PKT_FLAG_CORRUPT)) { av_log(s, AV_LOG_WARNING, -- cgit v1.2.3