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

Make saved-volume variable a per-libvlc instance rather than per-system process variable.

I find the original semantic a bit suspicious, but someone should really double check this commit and revert if needed.
parent 9270ed79
...@@ -165,8 +165,8 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps, ...@@ -165,8 +165,8 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps,
i_volume = AOUT_VOLUME_MAX; i_volume = AOUT_VOLUME_MAX;
} }
config_PutInt( p_object, "volume", i_volume ); config_PutInt( p_object, "volume", i_volume );
var_Create( p_object->p_libvlc_global, "saved-volume", VLC_VAR_INTEGER ); var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER );
var_SetInteger( p_object->p_libvlc_global, "saved-volume" , var_SetInteger( p_object->p_libvlc, "saved-volume" ,
(audio_volume_t) i_volume ); (audio_volume_t) i_volume );
if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume; if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume;
...@@ -205,8 +205,8 @@ int __aout_VolumeDown( vlc_object_t * p_object, int i_nb_steps, ...@@ -205,8 +205,8 @@ int __aout_VolumeDown( vlc_object_t * p_object, int i_nb_steps,
i_volume = AOUT_VOLUME_MIN; i_volume = AOUT_VOLUME_MIN;
} }
config_PutInt( p_object, "volume", i_volume ); config_PutInt( p_object, "volume", i_volume );
var_Create( p_object->p_libvlc_global, "saved-volume", VLC_VAR_INTEGER ); var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER );
var_SetInteger( p_object->p_libvlc_global, "saved-volume", (audio_volume_t) i_volume ); var_SetInteger( p_object->p_libvlc, "saved-volume", (audio_volume_t) i_volume );
if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume; if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume;
if ( p_aout == NULL ) return 0; if ( p_aout == NULL ) return 0;
...@@ -238,15 +238,15 @@ int __aout_VolumeMute( vlc_object_t * p_object, audio_volume_t * pi_volume ) ...@@ -238,15 +238,15 @@ int __aout_VolumeMute( vlc_object_t * p_object, audio_volume_t * pi_volume )
{ {
/* Mute */ /* Mute */
i_result = aout_VolumeSet( p_object, AOUT_VOLUME_MIN ); i_result = aout_VolumeSet( p_object, AOUT_VOLUME_MIN );
var_Create( p_object->p_libvlc_global, "saved-volume", VLC_VAR_INTEGER ); var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER );
var_SetInteger( p_object->p_libvlc_global, "saved-volume", (int)i_volume ); var_SetInteger( p_object->p_libvlc, "saved-volume", (int)i_volume );
if ( pi_volume != NULL ) *pi_volume = AOUT_VOLUME_MIN; if ( pi_volume != NULL ) *pi_volume = AOUT_VOLUME_MIN;
} }
else else
{ {
/* Un-mute */ /* Un-mute */
var_Create( p_object->p_libvlc_global, "saved-volume", VLC_VAR_INTEGER ); var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER );
i_volume = (audio_volume_t)var_GetInteger( p_object->p_libvlc_global, i_volume = (audio_volume_t)var_GetInteger( p_object->p_libvlc,
"saved-volume" ); "saved-volume" );
i_result = aout_VolumeSet( p_object, i_volume ); i_result = aout_VolumeSet( p_object, i_volume );
if ( pi_volume != NULL ) *pi_volume = i_volume; if ( pi_volume != NULL ) *pi_volume = i_volume;
......
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