diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 02:24:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 02:24:27 +0100 |
commit | 4362f272c0ae280cde833589e5c9c6696bd878d5 (patch) | |
tree | 540d690817dfd00dfc28f29a4843d911bd9850bf /libavcodec/rpza.c | |
parent | 8af7774c7aca6f3b595d0417b92f543ce0c7b537 (diff) | |
parent | 4a4841d4e0f0dc50998511bf6c48b518012024db (diff) | |
download | ffmpeg-4362f272c0ae280cde833589e5c9c6696bd878d5.tar.gz |
Merge commit '4a4841d4e0f0dc50998511bf6c48b518012024db'
* commit '4a4841d4e0f0dc50998511bf6c48b518012024db':
fraps: use the AVFrame API properly.
rpza: use the AVFrame API properly.
motionpixels: use the AVFrame API properly.
vmdvideo: use the AVFrame API properly.
Conflicts:
libavcodec/fraps.c
libavcodec/motionpixels.c
libavcodec/rpza.c
libavcodec/vmdav.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rpza.c')
-rw-r--r-- | libavcodec/rpza.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index 4917369de0..d4e2b17add 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -46,7 +46,7 @@ typedef struct RpzaContext { AVCodecContext *avctx; - AVFrame frame; + AVFrame *frame; const unsigned char *buf; int size; @@ -72,7 +72,7 @@ typedef struct RpzaContext { static void rpza_decode_stream(RpzaContext *s) { int width = s->avctx->width; - int stride = s->frame.linesize[0] / 2; + int stride = s->frame->linesize[0] / 2; int row_inc = stride - 4; int stream_ptr = 0; int chunk_size; @@ -82,7 +82,7 @@ static void rpza_decode_stream(RpzaContext *s) unsigned short color4[4]; unsigned char index, idx; unsigned short ta, tb; - unsigned short *pixels = (unsigned short *)s->frame.data[0]; + unsigned short *pixels = (unsigned short *)s->frame->data[0]; int row_ptr = 0; int pixel_ptr = -4; @@ -239,7 +239,9 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx) s->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_RGB555; - avcodec_get_frame_defaults(&s->frame); + s->frame = av_frame_alloc(); + if (!s->frame) + return AVERROR(ENOMEM); return 0; } @@ -256,12 +258,12 @@ static int rpza_decode_frame(AVCodecContext *avctx, s->buf = buf; s->size = buf_size; - if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) return ret; rpza_decode_stream(s); - if ((ret = av_frame_ref(data, &s->frame)) < 0) + if ((ret = av_frame_ref(data, s->frame)) < 0) return ret; *got_frame = 1; @@ -274,7 +276,7 @@ static av_cold int rpza_decode_end(AVCodecContext *avctx) { RpzaContext *s = avctx->priv_data; - av_frame_unref(&s->frame); + av_frame_free(&s->frame); return 0; } |