summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-27 14:28:56 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-10-27 14:28:56 +0100
commit7f5af80ba42bbd82da53dfd95236e9d47159a96a (patch)
treef85abbee087fa12065f02278c710ea4830c2cae5 /libavformat/utils.c
parent856b19d5935b544e96156f8e75e23b28c0a9f318 (diff)
parentce70f28a1732c74a9cd7fec2d56178750bd6e457 (diff)
Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3b6530f4ca..4044db32ea 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -237,7 +237,7 @@ static int append_packet_chunked(AVIOContext *s, AVPacket *pkt, int size)
pkt->pos = orig_pos;
if (!pkt->size)
- av_free_packet(pkt);
+ av_packet_unref(pkt);
return pkt->size > orig_size ? pkt->size - orig_size : ret;
}
@@ -696,7 +696,7 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_WARNING,
"Dropped corrupted packet (stream = %d)\n",
pkt->stream_index);
- av_free_packet(pkt);
+ av_packet_unref(pkt);
continue;
}
@@ -1188,7 +1188,7 @@ static void free_packet_buffer(AVPacketList **pkt_buf, AVPacketList **pkt_buf_en
while (*pkt_buf) {
AVPacketList *pktl = *pkt_buf;
*pkt_buf = pktl->next;
- av_free_packet(&pktl->pkt);
+ av_packet_unref(&pktl->pkt);
av_freep(&pktl);
}
*pkt_buf_end = NULL;
@@ -1282,7 +1282,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
goto fail;
if (!add_to_pktbuf(&s->internal->parse_queue, &out_pkt, &s->internal->parse_queue_end)) {
- av_free_packet(&out_pkt);
+ av_packet_unref(&out_pkt);
ret = AVERROR(ENOMEM);
goto fail;
}
@@ -1295,7 +1295,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
}
fail:
- av_free_packet(pkt);
+ av_packet_unref(pkt);
return ret;
}
@@ -1398,7 +1398,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
return ret;
} else {
/* free packet */
- av_free_packet(&cur_pkt);
+ av_packet_unref(&cur_pkt);
}
if (pkt->flags & AV_PKT_FLAG_KEY)
st->skip_to_keyframe = 0;
@@ -2131,7 +2131,7 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index,
} while (read_status == AVERROR(EAGAIN));
if (read_status < 0)
break;
- av_free_packet(&pkt);
+ av_packet_unref(&pkt);
if (stream_index == pkt.stream_index && pkt.dts > timestamp) {
if (pkt.flags & AV_PKT_FLAG_KEY)
break;
@@ -2535,7 +2535,7 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
st->info->last_duration = duration;
}
}
- av_free_packet(pkt);
+ av_packet_unref(pkt);
}
/* check if all audio/video streams have valid duration */
@@ -3664,7 +3664,7 @@ void ff_free_stream(AVFormatContext *s, AVStream *st) {
av_parser_close(st->parser);
}
if (st->attached_pic.data)
- av_free_packet(&st->attached_pic);
+ av_packet_unref(&st->attached_pic);
av_dict_free(&st->metadata);
av_freep(&st->probe_data.buf);
av_freep(&st->index_entries);