mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
audio: don't apply volume effect if backend has VOICE_VOLUME_CAP
If the audio backend is capable of volume control, don't apply software volume (mixeng_volume ()), but instead, rely on backend volume control. This will allow guest to have full range volume control. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
This commit is contained in:
parent
6c95ab94f9
commit
c01b245623
3 changed files with 14 additions and 2 deletions
|
@ -957,7 +957,9 @@ int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int size)
|
|||
total += isamp;
|
||||
}
|
||||
|
||||
mixeng_volume (sw->buf, ret, &sw->vol);
|
||||
if (!(hw->ctl_caps & VOICE_VOLUME_CAP)) {
|
||||
mixeng_volume (sw->buf, ret, &sw->vol);
|
||||
}
|
||||
|
||||
sw->clip (buf, sw->buf, ret);
|
||||
sw->total_hw_samples_acquired += total;
|
||||
|
@ -1041,7 +1043,10 @@ int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int size)
|
|||
swlim = audio_MIN (swlim, samples);
|
||||
if (swlim) {
|
||||
sw->conv (sw->buf, buf, swlim);
|
||||
mixeng_volume (sw->buf, swlim, &sw->vol);
|
||||
|
||||
if (!(sw->hw->ctl_caps & VOICE_VOLUME_CAP)) {
|
||||
mixeng_volume (sw->buf, swlim, &sw->vol);
|
||||
}
|
||||
}
|
||||
|
||||
while (swlim) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue