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

DBus: fix scale on setting volume

1.0 is nominal, not maximum. This is consistent with both VLC and the
MPRIS 2.1 specification. Also, the setter ought to have the same scale
as the getter!
parent e80f2349
...@@ -201,14 +201,12 @@ DBUS_METHOD( VolumeSet ) ...@@ -201,14 +201,12 @@ DBUS_METHOD( VolumeSet )
if( VLC_SUCCESS != DemarshalSetPropertyValue( p_from, &d_dbus_vol ) ) if( VLC_SUCCESS != DemarshalSetPropertyValue( p_from, &d_dbus_vol ) )
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
if( d_dbus_vol > 1. ) d_dbus_vol *= AOUT_VOLUME_DEFAULT;
d_dbus_vol = 1.; if( d_dbus_vol < 0. )
else if( d_dbus_vol < 0. )
d_dbus_vol = 0.; d_dbus_vol = 0.;
if( d_dbus_vol > AOUT_VOLUME_MAX )
double d_vol = d_dbus_vol * AOUT_VOLUME_MAX; d_dbus_vol = AOUT_VOLUME_MAX;
audio_volume_t i_vol = round( d_vol ); aout_VolumeSet( PL, lround(d_dbus_vol) );
aout_VolumeSet( PL, i_vol );
REPLY_SEND; REPLY_SEND;
} }
......
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