[vlc-devel] [PATCH 1/2] demux: subtitle: set length after subtitle reorder

Zhao Zhili quinkblack at foxmail.com
Thu Sep 20 17:36:02 CEST 2018


---
 modules/demux/subtitle.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 3b9836587a..4b7eeefd59 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -676,12 +676,6 @@ static int Open ( vlc_object_t *p_this )
 
     msg_Dbg(p_demux, "loaded %zu subtitles", p_sys->subtitles.i_count );
 
-    /* Fix subtitle (order and time) *** */
-    p_sys->subtitles.i_current = 0;
-    p_sys->i_length = 0;
-    if( p_sys->subtitles.i_count > 0 )
-        p_sys->i_length = p_sys->subtitles.p_array[p_sys->subtitles.i_count-1].i_stop;
-
     /* *** add subtitle ES *** */
     if( p_sys->props.i_type == SUB_TYPE_SSA1 ||
              p_sys->props.i_type == SUB_TYPE_SSA2_4 ||
@@ -698,6 +692,11 @@ static int Open ( vlc_object_t *p_this )
     else
         es_format_Init( &fmt, SPU_ES, VLC_CODEC_SUBT );
 
+    p_sys->subtitles.i_current = 0;
+    p_sys->i_length = 0;
+    if( p_sys->subtitles.i_count > 0 )
+        p_sys->i_length = p_sys->subtitles.p_array[p_sys->subtitles.i_count-1].i_stop;
+
     /* Stupid language detection in the filename */
     char * psz_language = get_language_from_filename( p_demux->psz_filepath );
 
-- 
2.19.0.rc1





More information about the vlc-devel mailing list