[vlc-commits] input/input: only select the first slave of each type
Thomas Guillem
git at videolan.org
Tue Jun 7 18:26:00 CEST 2016
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun 7 17:19:45 2016 +0200| [09e53a474854bee7e3bac05bf186f7d0fd6034a3] | committer: Thomas Guillem
input/input: only select the first slave of each type
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=09e53a474854bee7e3bac05bf186f7d0fd6034a3
---
src/input/input.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/input/input.c b/src/input/input.c
index 1fa356f..7dce0b8 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1111,6 +1111,9 @@ static void LoadSlaves( input_thread_t *p_input )
SlaveCompare );
/* add all detected slaves */
+ bool p_forced[2] = {};
+ static_assert( SLAVE_TYPE_AUDIO <= 1 && SLAVE_TYPE_SPU <= 1,
+ "slave type size mismatch");
for( int i = 0; i < i_slaves && pp_slaves[i] != NULL; i++ )
{
input_item_slave_t *p_slave = pp_slaves[i];
@@ -1118,13 +1121,15 @@ static void LoadSlaves( input_thread_t *p_input )
unsigned i_flags = p_slave->i_priority != SLAVE_PRIORITY_USER
? SLAVE_ADD_CANFAIL : SLAVE_ADD_NOFLAG;
- if( p_slave->b_forced || p_slave->i_priority == SLAVE_PRIORITY_USER )
+ if( !p_forced[p_slave->i_type]
+ && ( p_slave->b_forced || p_slave->i_priority == SLAVE_PRIORITY_USER ) )
i_flags |= SLAVE_ADD_FORCED;
if( input_SlaveSourceAdd( p_input, p_slave->i_type, p_slave->psz_uri,
i_flags ) == VLC_SUCCESS )
{
input_item_AddSlave( p_input->p->p_item, p_slave );
+ p_forced[p_slave->i_type] = true;
}
else
input_item_slave_Delete( p_slave );
More information about the vlc-commits
mailing list