summaryrefslogtreecommitdiff
path: root/ffmpeg/libavcodec/xbmdec.c
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-12-29 12:19:38 +0000
committerTim Redfern <tim@eclectronics.org>2013-12-29 12:19:38 +0000
commitf7813a5324be39d13ab536c245d15dfc602a7849 (patch)
treefad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/xbmdec.c
parentb7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff)
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/xbmdec.c')
-rw-r--r--ffmpeg/libavcodec/xbmdec.c14
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"),
};