]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xbm_parser.c
avcodec: Constify all the AVCodecParsers
[ffmpeg] / libavcodec / xbm_parser.c
index 30d23200db4f5dc974b2fe1b89fd611fb97277c4..28aae49ee3d935a7bcc90f18e7dd914e2ccddeb2 100644 (file)
@@ -34,7 +34,11 @@ typedef struct XBMParseContext {
     int count;
 } XBMParseContext;
 
-#define KEY (((uint64_t)'\n' << 56) | ((uint64_t)'#' << 48) | ((uint64_t)'d' << 40) | ((uint64_t)'e' << 32) | ((uint64_t)'f' << 24) | ('i' << 16) | ('n' << 8) | ('e' << 0))
+#define KEY (((uint64_t)'\n' << 56) | ((uint64_t)'#' << 48) | \
+             ((uint64_t)'d' << 40)  | ((uint64_t)'e' << 32) | \
+             ((uint64_t)'f' << 24) | ('i' << 16) | ('n' << 8) | \
+             ('e' << 0))
+
 #define END ((';' << 8) | ('\n' << 0))
 
 static int xbm_init(AVCodecParserContext *s)
@@ -55,7 +59,8 @@ static int xbm_parse(AVCodecParserContext *s, AVCodecContext *avctx,
     uint16_t state16 = bpc->state16;
     int next = END_NOT_FOUND, i = 0;
 
-    s->pict_type = AV_PICTURE_TYPE_NONE;
+    s->pict_type = AV_PICTURE_TYPE_I;
+    s->key_frame = 1;
     s->duration  = 1;
 
     *poutbuf_size = 0;
@@ -92,7 +97,7 @@ static int xbm_parse(AVCodecParserContext *s, AVCodecContext *avctx,
     return next;
 }
 
-AVCodecParser ff_xbm_parser = {
+const AVCodecParser ff_xbm_parser = {
     .codec_ids      = { AV_CODEC_ID_XBM },
     .priv_data_size = sizeof(XBMParseContext),
     .parser_init    = xbm_init,