[FFmpeg-devel] [PATCH] matroska decoder outputs subtitles data into video/audio stream

Aurelien Jacobs aurel
Sun Jun 24 23:50:47 CEST 2007

On Sun, 24 Jun 2007 19:25:12 +0200
"Joakim Plate" <joakim.plate at ecce.se> wrote:

> Hi, 
> Currently when matroska demuxer comes upon a track with subtitle data, it
> skips adding this to the stream collection in avformat. When it later get's
> a data packet for the subtitle stream, it assume that stream_index in the
> Track structure points to a valid avstream. Since the track structures is
> av_mallocz'ed, it will always point to stream index 0 for any track that
> wasn't added to the avstream collection.

Oh, that's a good catch !

> This patch allows the subtitle tracks to be added to the collection. This
> fixes the issue for subtitles, with the side effect that the data is
> available to any user of avformat (not that it's in any know format, but
> still). 

I recently started looking at implementing subtitle support in mkv demuxer.
I will do this modification when my subtitle support will be ready.
But it don't really fix the problem you describe (well, it don't fix it
for other unsupported kind of track).

> There probably still should be added some check in matroska_parse_block that
> the track the block belongs too, actually has a valid avstream. Maybe
> initing stream_index to (uint32)(-1) and checking for that would be good
> idea?

That's indeed a much better solution.
I've just commited a fix in this spirit.


More information about the ffmpeg-devel mailing list