aboutsummaryrefslogtreecommitdiff
path: root/audio/spiceaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/spiceaudio.c')
-rw-r--r--audio/spiceaudio.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
index 9860f9c5e1..6ed7f7a79e 100644
--- a/audio/spiceaudio.c
+++ b/audio/spiceaudio.c
@@ -179,13 +179,14 @@ static void line_out_enable(HWVoiceOut *hw, bool enable)
}
#if ((SPICE_INTERFACE_PLAYBACK_MAJOR >= 1) && (SPICE_INTERFACE_PLAYBACK_MINOR >= 2))
-static void line_out_volume(HWVoiceOut *hw, struct mixeng_volume *vol)
+static void line_out_volume(HWVoiceOut *hw, Volume *vol)
{
SpiceVoiceOut *out = container_of(hw, SpiceVoiceOut, hw);
uint16_t svol[2];
- svol[0] = vol->l / ((1ULL << 16) + 1);
- svol[1] = vol->r / ((1ULL << 16) + 1);
+ assert(vol->channels == 2);
+ svol[0] = vol->vol[0] * 257;
+ svol[1] = vol->vol[1] * 257;
spice_server_playback_set_volume(&out->sin, 2, svol);
spice_server_playback_set_mute(&out->sin, vol->mute);
}
@@ -262,13 +263,14 @@ static void line_in_enable(HWVoiceIn *hw, bool enable)
}
#if ((SPICE_INTERFACE_RECORD_MAJOR >= 2) && (SPICE_INTERFACE_RECORD_MINOR >= 2))
-static void line_in_volume(HWVoiceIn *hw, struct mixeng_volume *vol)
+static void line_in_volume(HWVoiceIn *hw, Volume *vol)
{
SpiceVoiceIn *in = container_of(hw, SpiceVoiceIn, hw);
uint16_t svol[2];
- svol[0] = vol->l / ((1ULL << 16) + 1);
- svol[1] = vol->r / ((1ULL << 16) + 1);
+ assert(vol->channels == 2);
+ svol[0] = vol->vol[0] * 257;
+ svol[1] = vol->vol[1] * 257;
spice_server_record_set_volume(&in->sin, 2, svol);
spice_server_record_set_mute(&in->sin, vol->mute);
}