Commit a8ffc3b8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: propagate current device to parent input manager

parent bd8485fc
......@@ -621,6 +621,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
/* Audio */
var_Create (mp, "aout", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
var_Create (mp, "audio-device", VLC_VAR_STRING);
var_Create (mp, "mute", VLC_VAR_BOOL);
var_Create (mp, "volume", VLC_VAR_FLOAT);
var_Create (mp, "corks", VLC_VAR_INTEGER);
......
......@@ -64,6 +64,15 @@ static int var_Copy (vlc_object_t *src, const char *name, vlc_value_t prev,
return var_Set (dst, name, value);
}
static int var_CopyDevice (vlc_object_t *src, const char *name,
vlc_value_t prev, vlc_value_t value, void *data)
{
vlc_object_t *dst = data;
(void) src; (void) name; (void) prev;
return var_Set (dst, "audio-device", value);
}
/**
* Supply or update the current custom ("hardware") volume.
* @note This only makes sense after calling aout_VolumeHardInit().
......@@ -192,6 +201,7 @@ audio_output_t *aout_New (vlc_object_t *parent)
var_Create (aout, "mute", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
var_AddCallback (aout, "mute", var_Copy, parent);
var_Create (aout, "device", VLC_VAR_STRING);
var_AddCallback (aout, "device", var_CopyDevice, parent);
aout->event.volume_report = aout_VolumeNotify;
aout->event.mute_report = aout_MuteNotify;
......@@ -324,6 +334,7 @@ void aout_Destroy (audio_output_t *aout)
aout_OutputUnlock (aout);
var_DelCallback (aout, "audio-filter", FilterCallback, NULL);
var_DelCallback (aout, "device", var_CopyDevice, aout->p_parent);
var_DelCallback (aout, "mute", var_Copy, aout->p_parent);
var_SetFloat (aout, "volume", -1.f);
var_DelCallback (aout, "volume", var_Copy, aout->p_parent);
......
......@@ -480,6 +480,7 @@ static void VariablesInit( playlist_t *p_playlist )
var_Create( p_playlist, "video-wallpaper", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* Audio output parameters */
var_Create( p_playlist, "audio-device", VLC_VAR_STRING );
var_Create( p_playlist, "mute", VLC_VAR_BOOL );
var_Create( p_playlist, "volume", VLC_VAR_FLOAT );
var_SetFloat( p_playlist, "volume", -1.f );
......
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