diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/ffv1.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/ffv1.c')
| -rw-r--r-- | ffmpeg/libavcodec/ffv1.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/ffmpeg/libavcodec/ffv1.c b/ffmpeg/libavcodec/ffv1.c index 404b0e3..f8556b0 100644 --- a/ffmpeg/libavcodec/ffv1.c +++ b/ffmpeg/libavcodec/ffv1.c @@ -1,7 +1,7 @@ /* * FFV1 codec for libavcodec * - * Copyright (c) 2003-2012 Michael Niedermayer <michaelni@gmx.at> + * Copyright (c) 2003-2013 Michael Niedermayer <michaelni@gmx.at> * * This file is part of FFmpeg. * @@ -25,6 +25,7 @@ * FF Video Codec 1 (a lossless codec) */ +#include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/crc.h" #include "libavutil/opt.h" @@ -48,7 +49,10 @@ av_cold int ffv1_common_init(AVCodecContext *avctx) s->avctx = avctx; s->flags = avctx->flags; - avcodec_get_frame_defaults(&s->picture); + s->picture.f = av_frame_alloc(); + s->last_picture.f = av_frame_alloc(); + if (!s->picture.f || !s->last_picture.f) + return AVERROR(ENOMEM); ff_dsputil_init(&s->dsp, avctx); @@ -62,7 +66,7 @@ av_cold int ffv1_common_init(AVCodecContext *avctx) return 0; } -int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) +av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) { int j; @@ -96,7 +100,7 @@ int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) return 0; } -int ffv1_init_slices_state(FFV1Context *f) +av_cold int ffv1_init_slices_state(FFV1Context *f) { int i, ret; for (i = 0; i < f->slice_count; i++) { @@ -191,7 +195,13 @@ av_cold int ffv1_close(AVCodecContext *avctx) FFV1Context *s = avctx->priv_data; int i, j; - av_frame_unref(&s->last_picture); + if (s->picture.f) + ff_thread_release_buffer(avctx, &s->picture); + av_frame_free(&s->picture.f); + + if (s->last_picture.f) + ff_thread_release_buffer(avctx, &s->last_picture); + av_frame_free(&s->last_picture.f); for (j = 0; j < s->slice_count; j++) { FFV1Context *fs = s->slice_context[j]; |
