Permalink
Browse files

rdpsnd/pulse: fix set volume synchronization.

  • Loading branch information...
1 parent e7fd72b commit cc9e584301f33c41409ed2aa31c4818e6cef5b9d @llyzs llyzs committed May 30, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 channels/rdpsnd/pulse/rdpsnd_pulse.c
View
3 channels/rdpsnd/pulse/rdpsnd_pulse.c
@@ -411,9 +411,12 @@ static void rdpsnd_pulse_set_volume(rdpsndDevicePlugin* device, uint32 value)
cv.channels = 2;
cv.values[0] = PA_VOLUME_MUTED + (left * (PA_VOLUME_NORM - PA_VOLUME_MUTED)) / 0xFFFF;
cv.values[1] = PA_VOLUME_MUTED + (right * (PA_VOLUME_NORM - PA_VOLUME_MUTED)) / 0xFFFF;
+
+ pa_threaded_mainloop_lock(pulse->mainloop);
operation = pa_context_set_sink_input_volume(pulse->context, pa_stream_get_index(pulse->stream), &cv, NULL, NULL);
if(operation)
pa_operation_unref(operation);
+ pa_threaded_mainloop_unlock(pulse->mainloop);
}
static void rdpsnd_pulse_play(rdpsndDevicePlugin* device, uint8* data, int size)

0 comments on commit cc9e584

Please sign in to comment.