]> git.sesse.net Git - ffmpeg/commitdiff
avformat/vobsub: compare correct packet stream IDs
authorwm4 <nfxjfg@googlemail.com>
Mon, 21 Sep 2015 10:09:08 +0000 (12:09 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 21 Sep 2015 10:55:13 +0000 (12:55 +0200)
The stream ID is essentially an arbitrary number defined by the .idx
file headers. They have to match the IDs in the .sub stream. The vobsub
demuxer assumed the IDs would just start from 0, increassing by 1 for
each stream. This is not correct. In the sample I had, the IDs were
starting from 1, leading to no subtitles being displayed at all.

Fix this by using the correct stream ID.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mpeg.c

index 223b6906d680aca85406fec93bcf3c166ebde827..a63b5672a3d49d18618a101968de7ca2a70e678f 100644 (file)
@@ -939,7 +939,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
         total_read += pkt_size;
 
         /* the current chunk doesn't match the stream index (unlikely) */
-        if ((startcode & 0x1f) != idx_pkt.stream_index)
+        if ((startcode & 0x1f) != s->streams[idx_pkt.stream_index]->id)
             break;
 
         ret = av_grow_packet(pkt, to_read);