diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2015-10-23 11:11:31 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-10-26 18:00:55 +0100 |
commit | ce70f28a1732c74a9cd7fec2d56178750bd6e457 (patch) | |
tree | 4e23c0b8181685ce4901250c8ee8468955bc362a /libavformat/avidec.c | |
parent | a5d42043093a39636a1f4021a37dd9c612479f6f (diff) | |
download | ffmpeg-ce70f28a1732c74a9cd7fec2d56178750bd6e457.tar.gz |
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`.
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } } |