aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
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 13:27:17 +0100
commit4a4841d4e0f0dc50998511bf6c48b518012024db (patch)
treeacafa6bb04ac75cca4fb0c68944355fd2d46f8ab /libavcodec
parente8ef8a328c81daf03e9c7fb90553e38330b97d2c (diff)
downloadffmpeg-4a4841d4e0f0dc50998511bf6c48b518012024db.tar.gz
fraps: use the AVFrame API properly.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/fraps.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index 438c215152..f12e4e01ba 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -45,7 +45,7 @@
*/
typedef struct FrapsContext {
AVCodecContext *avctx;
- AVFrame frame;
+ AVFrame *frame;
uint8_t *tmpbuf;
int tmpbuf_size;
DSPContext dsp;
@@ -66,7 +66,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->avctx = avctx;
s->tmpbuf = NULL;
- avcodec_get_frame_defaults(&s->frame);
+ s->frame = av_frame_alloc();
+ if (!s->frame)
+ return AVERROR(ENOMEM);
ff_dsputil_init(&s->dsp, avctx);
@@ -136,7 +138,7 @@ static int decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AVFrame *frame = data;
- AVFrame * const f = &s->frame;
+ AVFrame * const f = s->frame;
uint32_t header;
unsigned int version,header_size;
unsigned int x, y;
@@ -361,7 +363,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
{
FrapsContext *s = (FrapsContext*)avctx->priv_data;
- av_frame_unref(&s->frame);
+ av_frame_free(&s->frame);
av_freep(&s->tmpbuf);
return 0;