]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvdsub_parser.c
Move the AVCodecContext options definition to a dedicated file, reduce
[ffmpeg] / libavcodec / dvdsub_parser.c
index a823ab9f3b21fcf361be58e0f2cbc3d1930da1f0..0893daca658714598f2a2d9003a0dbb7ea1109f0 100644 (file)
@@ -34,7 +34,7 @@ static int dvdsub_parse_init(AVCodecParserContext *s)
 
 static int dvdsub_parse(AVCodecParserContext *s,
                         AVCodecContext *avctx,
-                        uint8_t **poutbuf, int *poutbuf_size,
+                        const uint8_t **poutbuf, int *poutbuf_size,
                         const uint8_t *buf, int buf_size)
 {
     DVDSubParseContext *pc = s->priv_data;
@@ -43,6 +43,8 @@ static int dvdsub_parse(AVCodecParserContext *s,
         if (buf_size < 2)
             return 0;
         pc->packet_len = AV_RB16(buf);
+        if (pc->packet_len == 0) /* HD-DVD subpicture packet */
+            pc->packet_len = AV_RB32(buf+2);
         av_freep(&pc->packet);
         pc->packet = av_malloc(pc->packet_len);
     }