[pulseaudio] Extra state check when changing volume

This commit is contained in:
ejurgensen 2016-08-28 22:33:58 +02:00
parent 4318aa19b5
commit 1d862dd701
1 changed files with 3 additions and 0 deletions

View File

@ -655,6 +655,9 @@ pulse_device_volume_set(struct output_device *device, output_status_cb cb)
ps = device->session->session;
if ((context_check(p->context) < 0) || (stream_check(p, ps) < 0))
return 0;
vol = PA_VOLUME_MUTED + (device->volume * (PA_VOLUME_NORM - PA_VOLUME_MUTED)) / 100;
pa_cvolume_set(&cvol, 2, vol);