summaryrefslogtreecommitdiff
path: root/libavcodec/pnm.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2009-10-27 17:15:05 +0000
committerDiego Biurrun <diego@biurrun.de>2009-10-27 17:15:05 +0000
commit8767a009a1dc27b07a2d3dca8679748e06fcc7e1 (patch)
treecf75e435ca405b317738f669fcbfb16d90f365ed /libavcodec/pnm.c
parentd3067047e71e0cc975fb85be5a0f5c3b50ed6969 (diff)
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
Diffstat (limited to 'libavcodec/pnm.c')
-rw-r--r--libavcodec/pnm.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index a081f34fa8..4fd9c61a24 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -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;
+}