Mercurial > libavcodec.hg
diff pnm.c @ 10460:059265d3cc65 libavcodec
Move PNM init/end functions to the PNM common code.
This is done in preparation for the PNM encoder/decoder split.
author | diego |
---|---|
date | Tue, 27 Oct 2009 17:15:05 +0000 |
parents | a6bb56636f90 |
children | d6860312274c |
line wrap: on
line diff
--- a/pnm.c Tue Oct 27 16:57:35 2009 +0000 +++ b/pnm.c Tue Oct 27 17:15:05 2009 +0000 @@ -162,3 +162,23 @@ } return 0; } + +av_cold int ff_pnm_end(AVCodecContext *avctx) +{ + PNMContext *s = avctx->priv_data; + + if (s->picture.data[0]) + avctx->release_buffer(avctx, &s->picture); + + return 0; +} + +av_cold int ff_pnm_init(AVCodecContext *avctx) +{ + PNMContext *s = avctx->priv_data; + + avcodec_get_frame_defaults((AVFrame*)&s->picture); + avctx->coded_frame = (AVFrame*)&s->picture; + + return 0; +}