[vlc-devel] [PATCH] vobsub idx in mkv track CodecPrivate data

Jean-Baptiste Kempf jb at videolan.org
Tue May 12 17:14:46 CEST 2009


On Tue, May 12, 2009 at 08:02:37AM -0700, John Stebbins wrote :
> I'm adding vobsub support to handbrake and was using vlc as one means to  
> verify my work.  I noticed that vlc wasn't using the palette contained  
Great.

> in the mkv track CodecPrivate data.  When I looked deeper into it, I  
> discovered it was ignoring the idx data entirely.  Here's a patch to  
> modules/demux/avformat/demux.c that checks that the container is  
> matroska, and that the subtitle type is vobsub.  Then parses  
> AVCodecContext.extradata (where avformat stashes matroska track  
> CodecPrivate).

I have to say that it is weird, since matroska demuxer should fire up
before avformat...
Do you have it (vlc --list) ?

> +            if (strncmp(p_sys->ic->iformat->name, "matroska", 8) == 0 &&
Coding style is not good, I would say...

> +                cc->codec_id == CODEC_ID_DVD_SUBTITLE)
> +            {
> +                char *pos;
> +
> +                pos = strstr((char*)cc->extradata, "size:");
Shouldn't it be (const char*)?
Coding style too.

> +                pos = strstr((char*)cc->extradata, "palette:");
Same.

> +                    int j;
> +                    for( j = 1; j < 17; j++ )
VLC is C99, so you can declare j in the for(, just FYI.

Anyway, it seems to work.

    Best Regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/



More information about the vlc-devel mailing list