]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vc1_parser.c
bmpdec: proper check for alpha
[ffmpeg] / libavcodec / vc1_parser.c
index 99023db492c75c605e57f3d58ebc95804e76a116..a4130d9885693bae36ceda3398822982b0be3d21 100644 (file)
@@ -96,7 +96,7 @@ static void vc1_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx,
 }
 
 /**
- * finds the end of the current frame in the bitstream.
+ * Find the end of the current frame in the bitstream.
  * @return the position of the first byte of the next frame, or -1
  */
 static int vc1_find_frame_end(ParseContext *pc, const uint8_t *buf,
@@ -184,11 +184,18 @@ static int vc1_split(AVCodecContext *avctx,
     return 0;
 }
 
+static int vc1_parse_init(AVCodecParserContext *s)
+{
+    VC1ParseContext *vpc = s->priv_data;
+    vpc->v.s.slice_context_count = 1;
+    return 0;
+}
+
 AVCodecParser ff_vc1_parser = {
-    { CODEC_ID_VC1 },
-    sizeof(VC1ParseContext),
-    NULL,
-    vc1_parse,
-    ff_parse1_close,
-    vc1_split,
+    .codec_ids      = { CODEC_ID_VC1 },
+    .priv_data_size = sizeof(VC1ParseContext),
+    .parser_init    = vc1_parse_init,
+    .parser_parse   = vc1_parse,
+    .parser_close   = ff_parse1_close,
+    .split          = vc1_split,
 };