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 /libavcodec/utils.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 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 63f09ff15b..ad00a9215a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1200,7 +1200,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, *got_packet_ptr = 0; if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) { - av_free_packet(avpkt); + av_packet_unref(avpkt); av_init_packet(avpkt); return 0; } @@ -1276,7 +1276,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, } if (ret < 0 || !*got_packet_ptr) { - av_free_packet(avpkt); + av_packet_unref(avpkt); av_init_packet(avpkt); goto end; } @@ -1307,7 +1307,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, *got_packet_ptr = 0; if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) { - av_free_packet(avpkt); + av_packet_unref(avpkt); av_init_packet(avpkt); avpkt->size = 0; return 0; @@ -1335,7 +1335,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, } if (ret < 0 || !*got_packet_ptr) - av_free_packet(avpkt); + av_packet_unref(avpkt); emms_c(); return ret; |