[vlc-devel] [RFC PATCH] demux: subtitle: workaround out-of-order samples

Zhao Zhili quinkblack at foxmail.com
Tue Sep 4 08:57:27 CEST 2018


---
A test sample:
https://drive.google.com/open?id=11kQP2OrbFyPnmbH9BPS__kJzbsXKmAQT

I totally understand it may not worth to support such broken files. In
this case, it looks like a small effort. The time takes by Fix() is
less than 200 us on my PC with the sample.

 modules/demux/subtitle.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 9af186e..5e64ba4 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -696,7 +696,10 @@ static int Open ( vlc_object_t *p_this )
         fmt.subs.cc.i_reorder_depth = -1;
     }
     else
+    {
+        Fix( p_demux );
         es_format_Init( &fmt, SPU_ES, VLC_CODEC_SUBT );
+    }
 
     /* Stupid language detection in the filename */
     char * psz_language = get_language_from_filename( p_demux->psz_filepath );
-- 
2.9.5



More information about the vlc-devel mailing list