From ce70f28a1732c74a9cd7fec2d56178750bd6e457 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 23 Oct 2015 11:11:31 +0200 Subject: avpacket: Replace av_free_packet with av_packet_unref `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`. --- libavformat/avidec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavformat/avidec.c') diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 63afe2f397..659bfa7b6d 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1215,7 +1215,7 @@ resync: pkt->buf = avbuf; pkt->flags |= AV_PKT_FLAG_KEY; if (size < 0) - av_free_packet(pkt); + av_packet_unref(pkt); } else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE && !st->codec->codec_tag && read_gab2_sub(st, pkt)) { ast->frame_offset++; @@ -1470,7 +1470,7 @@ static void seek_subtitle(AVStream *st, AVStream *st2, int64_t timestamp) { AVIStream *ast2 = st2->priv_data; int64_t ts2 = av_rescale_q(timestamp, st->time_base, st2->time_base); - av_free_packet(&ast2->sub_pkt); + av_packet_unref(&ast2->sub_pkt); if (avformat_seek_file(ast2->sub_ctx, 0, INT64_MIN, ts2, ts2, 0) >= 0 || avformat_seek_file(ast2->sub_ctx, 0, ts2, ts2, INT64_MAX, 0) >= 0) ff_read_packet(ast2->sub_ctx, &ast2->sub_pkt); @@ -1587,7 +1587,7 @@ static int avi_read_close(AVFormatContext *s) avformat_close_input(&ast->sub_ctx); } av_free(ast->sub_buffer); - av_free_packet(&ast->sub_pkt); + av_packet_unref(&ast->sub_pkt); } } -- cgit v1.2.3