Commit f335a2a0 authored by Laurent Aimar's avatar Laurent Aimar

* input: fix to avoid forced subtitle not selected.

parent 34f4d18f
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2004 VideoLAN * Copyright (C) 1998-2004 VideoLAN
* $Id: input.c,v 1.273 2004/01/06 12:02:06 zorglub Exp $ * $Id: input.c,v 1.274 2004/01/07 17:57:56 fenrir Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -544,13 +544,14 @@ static int InitThread( input_thread_t * p_input ) ...@@ -544,13 +544,14 @@ static int InitThread( input_thread_t * p_input )
float f_fps; float f_fps;
playlist_t *p_playlist; playlist_t *p_playlist;
mtime_t i_length; mtime_t i_length;
/* Parse source string. Syntax : [[<access>][/<demux>]:][<source>] */ /* Parse source string. Syntax : [[<access>][/<demux>]:][<source>] */
char * psz_parser = p_input->psz_dupsource = strdup(p_input->psz_source); char * psz_parser = p_input->psz_dupsource = strdup(p_input->psz_source);
vlc_value_t val; vlc_value_t val;
subtitle_demux_t *p_sub;
int64_t i_microsecondperframe; int64_t i_microsecondperframe;
subtitle_demux_t *p_sub_toselect = NULL;
/* Skip the plug-in names */ /* Skip the plug-in names */
while( *psz_parser && *psz_parser != ':' ) while( *psz_parser && *psz_parser != ':' )
{ {
...@@ -824,11 +825,10 @@ static int InitThread( input_thread_t * p_input ) ...@@ -824,11 +825,10 @@ static int InitThread( input_thread_t * p_input )
var_Get( p_input, "sub-file", &val ); var_Get( p_input, "sub-file", &val );
if( val.psz_string && *val.psz_string ) if( val.psz_string && *val.psz_string )
{ {
subtitle_demux_t *p_sub;
if( ( p_sub = subtitle_New( p_input, strdup(val.psz_string), i_microsecondperframe, 0 ) ) ) if( ( p_sub = subtitle_New( p_input, strdup(val.psz_string), i_microsecondperframe, 0 ) ) )
{ {
/* Select this ES by default */ p_sub_toselect = p_sub;
es_out_Control( p_input->p_es_out, ES_OUT_SET_ES_STATE, p_sub->p_es, VLC_TRUE );
TAB_APPEND( p_input->p_sys->i_sub, p_input->p_sys->sub, p_sub ); TAB_APPEND( p_input->p_sys->i_sub, p_input->p_sys->sub, p_sub );
} }
} }
...@@ -837,6 +837,7 @@ static int InitThread( input_thread_t * p_input ) ...@@ -837,6 +837,7 @@ static int InitThread( input_thread_t * p_input )
var_Get( p_input, "sub-autodetect-file", &val ); var_Get( p_input, "sub-autodetect-file", &val );
if( val.b_bool ) if( val.b_bool )
{ {
subtitle_demux_t *p_sub;
int i; int i;
char **tmp = subtitles_Detect( p_input, "", p_input->psz_source ); char **tmp = subtitles_Detect( p_input, "", p_input->psz_source );
char **tmp2 = tmp; char **tmp2 = tmp;
...@@ -858,6 +859,10 @@ static int InitThread( input_thread_t * p_input ) ...@@ -858,6 +859,10 @@ static int InitThread( input_thread_t * p_input )
} }
es_out_Control( p_input->p_es_out, ES_OUT_SET_MODE, es_out_Control( p_input->p_es_out, ES_OUT_SET_MODE,
val.b_bool ? ES_OUT_MODE_ALL : ES_OUT_MODE_AUTO ); val.b_bool ? ES_OUT_MODE_ALL : ES_OUT_MODE_AUTO );
if( p_sub_toselect )
{
es_out_Control( p_input->p_es_out, ES_OUT_SET_ES, p_sub_toselect->p_es, VLC_TRUE );
}
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment