From f7813a5324be39d13ab536c245d15dfc602a7849 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 29 Dec 2013 12:19:38 +0000 Subject: basic type mechanism working --- ffmpeg/libavcodec/xbmdec.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'ffmpeg/libavcodec/xbmdec.c') diff --git a/ffmpeg/libavcodec/xbmdec.c b/ffmpeg/libavcodec/xbmdec.c index 51f88a2..2976bec 100644 --- a/ffmpeg/libavcodec/xbmdec.c +++ b/ffmpeg/libavcodec/xbmdec.c @@ -27,6 +27,7 @@ static av_cold int xbm_decode_init(AVCodecContext *avctx) { + avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; return 0; } @@ -56,7 +57,7 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data, int number, len; ptr += strcspn(ptr, "#"); - if (sscanf(ptr, "#define %256s %u", name, &number) != 2) { + if (sscanf(ptr, "#define %255s %u", name, &number) != 2) { av_log(avctx, AV_LOG_ERROR, "Unexpected preprocessor directive\n"); return AVERROR_INVALIDDATA; } @@ -73,8 +74,6 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data, ptr += strcspn(ptr, "\n\r") + 1; } - avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; - if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; @@ -109,19 +108,12 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -static av_cold int xbm_decode_close(AVCodecContext *avctx) -{ - - return 0; -} - AVCodec ff_xbm_decoder = { .name = "xbm", + .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_XBM, .init = xbm_decode_init, - .close = xbm_decode_close, .decode = xbm_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), }; -- cgit v1.2.3