Commit f81b16e5 authored by Thomas Guillem's avatar Thomas Guillem

libvlc: change libvlc_media_player_add_slave arguments

The last boolean argument is used to force the selection of a slave.
parent 09e53a47
......@@ -967,13 +967,14 @@ LIBVLC_API void libvlc_media_player_set_video_title_display( libvlc_media_player
* \param p_mi the media player
* \param i_type subtitle or audio
* \param psz_uri Uri of the slave (should contain a valid scheme).
* \param b_select True if this slave should be selected when it's loaded
*
* \return 0 on success, -1 on error.
*/
LIBVLC_API
int libvlc_media_player_add_slave( libvlc_media_player_t *p_mi,
libvlc_media_slave_type_t i_type,
const char *psz_uri );
const char *psz_uri, bool b_select );
/**
* Release (free) libvlc_track_description_t
......
......@@ -475,7 +475,7 @@ enum input_query_e
INPUT_GET_ATTACHMENT, /* arg1=input_attachment_t**, arg2=char* res=can fail */
/* On the fly input slave */
INPUT_ADD_SLAVE, /* arg1= const char * */
INPUT_ADD_SLAVE, /* arg1= enum slave_type, arg2= const char *, arg3= bool */
INPUT_ADD_SUBTITLE, /* arg1= const char *, arg2=bool b_check_extension */
/* On the fly record while playing */
......@@ -604,9 +604,9 @@ static inline int input_AddSubtitleOSD( input_thread_t *p_input, const char *psz
#define input_AddSubtitle(a, b, c) input_AddSubtitleOSD(a, b, c, false)
static inline int input_AddSlave( input_thread_t *p_input, enum slave_type type,
const char *psz_uri )
const char *psz_uri, bool b_forced )
{
return input_Control( p_input, INPUT_ADD_SLAVE, type, psz_uri );
return input_Control( p_input, INPUT_ADD_SLAVE, type, psz_uri, b_forced );
}
......
......@@ -1895,7 +1895,7 @@ void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, l
int libvlc_media_player_add_slave( libvlc_media_player_t *p_mi,
libvlc_media_slave_type_t i_type,
const char *psz_uri )
const char *psz_uri, bool b_select )
{
input_thread_t *p_input_thread = libvlc_get_input_thread ( p_mi );
......@@ -1911,7 +1911,7 @@ int libvlc_media_player_add_slave( libvlc_media_player_t *p_mi,
}
else
{
int i_ret = input_AddSlave( p_input_thread, i_type, psz_uri );
int i_ret = input_AddSlave( p_input_thread, i_type, psz_uri, b_select );
vlc_object_release( p_input_thread );
return i_ret == VLC_SUCCESS ? 0 : -1;
......
......@@ -433,6 +433,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
{
enum slave_type type = (enum slave_type) va_arg( args, enum slave_type );
psz = (char*)va_arg( args, char * );
b_bool = (bool)va_arg( args, int );
if( !psz || ( type != SLAVE_TYPE_SPU && type != SLAVE_TYPE_AUDIO ) )
return VLC_EGENERIC;
......@@ -441,6 +442,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
input_item_slave_New( psz, type, SLAVE_PRIORITY_USER );
if( !p_slave )
return VLC_ENOMEM;
p_slave->b_forced = b_bool;
val.p_address = p_slave;
input_ControlPush( p_input, INPUT_CONTROL_ADD_SLAVE, &val );
......
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