summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2015-10-23 11:11:30 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-10-26 18:00:55 +0100
commita5d42043093a39636a1f4021a37dd9c612479f6f (patch)
tree5251d15df14348365b3ae67514bc0fac0d0447ab /libavformat/utils.c
parentf0ca6ffa0ae5d5564516ee7a18aa1e234751444a (diff)
avformat: Always return ref-counted AVPacket
And drop the av_dup_packet from the input_thread.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c8
1 files changed, 8 insertions, 0 deletions
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,