summaryrefslogtreecommitdiff
path: root/libavcodec/libschroedingerenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-09 10:14:46 +0100
committerAnton Khirnov <anton@khirnov.net>2013-11-16 17:49:31 +0100
commit372262853b31cfde542ce1e3e1c154e590e35476 (patch)
treec32de787aad34a64e189f5e6a5e8541c0faccaf4 /libavcodec/libschroedingerenc.c
parent97168b204a0b6b79bb6c5f0d40efdf7fc2262476 (diff)
libschroedingerenc: use the AVFrame API properly.
Diffstat (limited to 'libavcodec/libschroedingerenc.c')
-rw-r--r--libavcodec/libschroedingerenc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c
index e4789ee7c2..11cc0ebd31 100644
--- a/libavcodec/libschroedingerenc.c
+++ b/libavcodec/libschroedingerenc.c
@@ -49,9 +49,6 @@ typedef struct SchroEncoderParams {
/** Schroedinger frame format */
SchroFrameFormat frame_format;
- /** frame being encoded */
- AVFrame picture;
-
/** frame size */
int frame_size;
@@ -164,7 +161,9 @@ static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
avctx->width,
avctx->height);
- avctx->coded_frame = &p_schro_params->picture;
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
if (!avctx->gop_size) {
schro_encoder_setting_set_double(p_schro_params->encoder,
@@ -432,6 +431,8 @@ static int libschroedinger_encode_close(AVCodecContext *avctx)
/* Free the video format structure. */
av_freep(&p_schro_params->format);
+ av_frame_free(&avctx->coded_frame);
+
return 0;
}