]> git.sesse.net Git - ffmpeg/commitdiff
avformat/vobsub: do not attempt to check duplicate subtitles
authorwm4 <nfxjfg@googlemail.com>
Mon, 21 Sep 2015 11:43:32 +0000 (13:43 +0200)
committerwm4 <nfxjfg@googlemail.com>
Mon, 21 Sep 2015 11:43:32 +0000 (13:43 +0200)
Some .idx files actually contain duplicate subtitle events:

timestamp: 00:07:52:600, filepos: 00004e800
timestamp: 00:07:52:600, filepos: 00004f800

The second will be dropped, because it has same pts, duration, and text
(the text is just a dummy empty string; the real data is retrieved when
actually reading vobsub subtitle packets).

Dropping this is probably not intended/safe, so avoid it.

See trac issue #4872 for a sample. This patch doesn't fix decoding of
the sample, though.

libavformat/mpeg.c

index a63b5672a3d49d18618a101968de7ca2a70e678f..55f2b3fb6872c9a8083d3440a21d7e0bc7880d57 100644 (file)
@@ -857,6 +857,7 @@ static int vobsub_read_header(AVFormatContext *s)
 
     for (i = 0; i < s->nb_streams; i++) {
         vobsub->q[i].sort = SUB_SORT_POS_TS;
+        vobsub->q[i].keep_duplicates = 1;
         ff_subtitles_queue_finalize(s, &vobsub->q[i]);
     }