diff options
Diffstat (limited to 'ffmpeg/libavcodec/xbmdec.c')
| -rw-r--r-- | ffmpeg/libavcodec/xbmdec.c | 14 |
1 files changed, 3 insertions, 11 deletions
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"), }; |
