summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/avcodec.c')
-rw-r--r--libavcodec/avcodec.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index c9105c5df2..f82d9e9f74 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -388,6 +388,8 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
}
if (avci->in_frame)
av_frame_unref(avci->in_frame);
+ if (avci->recon_frame)
+ av_frame_unref(avci->recon_frame);
} else {
av_packet_unref(avci->last_pkt_props);
while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0)
@@ -468,6 +470,7 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_packet_free(&avci->in_pkt);
av_frame_free(&avci->in_frame);
+ av_frame_free(&avci->recon_frame);
av_buffer_unref(&avci->pool);
@@ -718,3 +721,12 @@ int avcodec_is_open(AVCodecContext *s)
{
return !!s->internal;
}
+
+int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
+{
+ av_frame_unref(frame);
+
+ if (av_codec_is_decoder(avctx->codec))
+ return ff_decode_receive_frame(avctx, frame);
+ return ff_encode_receive_frame(avctx, frame);
+}