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

aout: convert audio output "volume" to float

parent 7af353d6
......@@ -73,7 +73,7 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
vlc_value_t val, text;
char *str;
var_Create (aout, "volume", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
var_Create (aout, "volume", VLC_VAR_FLOAT);
var_Create (aout, "mute", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
/* Visualizations */
......
......@@ -72,9 +72,9 @@ float aout_VolumeGet (vlc_object_t *obj)
if (aout == NULL)
return -1.f;
long l = var_InheritInteger (aout, "volume");
float volume = var_GetFloat (aout, "volume");
vlc_object_release (aout);
return l / (float)AOUT_VOLUME_DEFAULT;
return volume;
}
#undef aout_VolumeSet
......
......@@ -91,11 +91,7 @@ static void aout_OutputTimeReport (audio_output_t *aout, mtime_t ideal)
*/
static void aout_OutputVolumeReport (audio_output_t *aout, float volume)
{
long vol = lroundf (volume * (float)AOUT_VOLUME_DEFAULT);
/* We cannot acquire the volume lock as this gets called from the audio
* output plug-in (it would cause a lock inversion). */
var_SetInteger (aout, "volume", vol);
var_SetFloat (aout, "volume", volume);
}
static void aout_OutputMuteReport (audio_output_t *aout, bool mute)
......
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