[vlc-commits] demux: subtitle: set length after subtitle reorder
Zhao Zhili
git at videolan.org
Mon Oct 1 12:00:55 CEST 2018
vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Thu Sep 20 23:36:02 2018 +0800| [0db0a4449467cef70caaa4caf2d8968b4e960e17] | committer: Thomas Guillem
demux: subtitle: set length after subtitle reorder
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0db0a4449467cef70caaa4caf2d8968b4e960e17
---
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 );
More information about the vlc-commits
mailing list