mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-06 15:49:50 +08:00
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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user