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

PulseAudio: clean volume conversion boundaries a bit

parent 26921e30
...@@ -569,15 +569,16 @@ static int VolumeSet(audio_output_t *aout, float vol) ...@@ -569,15 +569,16 @@ static int VolumeSet(audio_output_t *aout, float vol)
aout_sys_t *sys = aout->sys; aout_sys_t *sys = aout->sys;
pa_stream *s = sys->stream; pa_stream *s = sys->stream;
pa_operation *op; pa_operation *op;
pa_volume_t volume;
/* VLC provides the software volume so convert directly to PulseAudio /* VLC provides the software volume so convert directly to PulseAudio
* software volume, pa_volume_t. This is not a linear amplification factor * software volume, pa_volume_t. This is not a linear amplification factor
* so do not use PulseAudio linear amplification! */ * so do not use PulseAudio linear amplification! */
vol *= PA_VOLUME_NORM; vol *= PA_VOLUME_NORM;
if (unlikely(vol >= PA_VOLUME_MAX)) if (unlikely(vol >= (float)PA_VOLUME_MAX))
vol = PA_VOLUME_MAX; volume = PA_VOLUME_MAX;
else
pa_volume_t volume = lroundf(vol); volume = lroundf(vol);
if (s == NULL) if (s == NULL)
{ {
......
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