summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c8
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;