Commit 41043143 authored by Thomas Guillem's avatar Thomas Guillem

input: force subtitles coming from subtitles_Detect

This restore an historical behavior that was removed with input slaves patches.
parent 8da9a848
...@@ -161,6 +161,7 @@ struct input_item_slave ...@@ -161,6 +161,7 @@ struct input_item_slave
{ {
enum slave_type i_type; /**< Slave type (spu, audio) */ enum slave_type i_type; /**< Slave type (spu, audio) */
enum slave_priority i_priority; /**< Slave priority */ enum slave_priority i_priority; /**< Slave priority */
bool b_forced; /**< Slave should be selected */
char psz_uri[]; /**< Slave mrl */ char psz_uri[]; /**< Slave mrl */
}; };
......
...@@ -1079,8 +1079,10 @@ static void LoadSlaves( input_thread_t *p_input ) ...@@ -1079,8 +1079,10 @@ static void LoadSlaves( input_thread_t *p_input )
if( p_slave->i_type == SLAVE_TYPE_SPU ) if( p_slave->i_type == SLAVE_TYPE_SPU )
{ {
msg_Err( p_input, "Loading spu slave: %s", p_slave->psz_uri ); msg_Err( p_input, "Loading spu slave: %s", p_slave->psz_uri );
const unsigned i_flags = p_slave->i_priority == SLAVE_PRIORITY_USER unsigned i_flags = p_slave->i_priority == SLAVE_PRIORITY_USER
? SUB_FORCED : SUB_CANFAIL; ? SUB_FORCED : SUB_CANFAIL;
if( p_slave->b_forced )
i_flags |= SUB_FORCED;
input_SubtitleAdd( p_input, p_slave->psz_uri, i_flags ); input_SubtitleAdd( p_input, p_slave->psz_uri, i_flags );
} }
else else
......
...@@ -653,6 +653,7 @@ input_item_slave_t *input_item_slave_New(const char *psz_uri, enum slave_type i_ ...@@ -653,6 +653,7 @@ input_item_slave_t *input_item_slave_New(const char *psz_uri, enum slave_type i_
p_slave->i_type = i_type; p_slave->i_type = i_type;
p_slave->i_priority = i_priority; p_slave->i_priority = i_priority;
p_slave->b_forced = false;
strcpy( p_slave->psz_uri, psz_uri ); strcpy( p_slave->psz_uri, psz_uri );
return p_slave; return p_slave;
......
...@@ -334,7 +334,10 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na ...@@ -334,7 +334,10 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na
input_item_slave_New( psz_uri, SLAVE_TYPE_SPU, i_prio ) input_item_slave_New( psz_uri, SLAVE_TYPE_SPU, i_prio )
: NULL; : NULL;
if( p_sub ) if( p_sub )
{
p_sub->b_forced = true;
INSERT_ELEM( pp_slaves, i_slaves, i_slaves, p_sub ); INSERT_ELEM( pp_slaves, i_slaves, i_slaves, p_sub );
}
free( psz_uri ); free( psz_uri );
} }
free( path ); free( path );
......
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