Move PNM init/end functions to the PNM common code.

This is done in preparation for the PNM encoder/decoder split.

Originally committed as revision 20382 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Diego Biurrun
2009-10-27 17:15:05 +00:00
parent d3067047e7
commit 8767a009a1
3 changed files with 37 additions and 35 deletions

View File

@ -162,3 +162,23 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
}
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;
}