From b79cac86d01b764b9b3605baa63e9e6b6b866955 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <4b2df53c087cd9df02d66686da40ae4f600f3904.1358959439.git.minovotn@redhat.com> References: <4b2df53c087cd9df02d66686da40ae4f600f3904.1358959439.git.minovotn@redhat.com> From: Markus Armbruster Date: Wed, 23 Jan 2013 15:52:31 +0100 Subject: [PATCH 5/7] Revert "audio: don't apply volume effect if backend has VOICE_VOLUME_CAP" RH-Author: Markus Armbruster Message-id: <1358956353-15195-6-git-send-email-armbru@redhat.com> Patchwork-id: 47667 O-Subject: [RHEL-6.4 PATCH qemu-kvm 5/7] Revert "audio: don't apply volume effect if backend has VOICE_VOLUME_CAP" Bugzilla: 884253 RH-Acked-by: Ademar de Souza Reis Jr. RH-Acked-by: Alex Williamson RH-Acked-by: Gerd Hoffmann This reverts commit d6a7a4196972f9e358a4728fa7747944c1f172fc. Signed-off-by: Markus Armbruster --- audio/audio.c | 9 ++------- audio/audio_int.h | 5 ----- audio/audio_template.h | 2 -- 3 files changed, 2 insertions(+), 14 deletions(-) Signed-off-by: Michal Novotny --- audio/audio.c | 9 ++------- audio/audio_int.h | 5 ----- audio/audio_template.h | 2 -- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index f3e575f..565248e 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -945,9 +945,7 @@ int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int size) total += isamp; } - if (!(hw->ctl_caps & VOICE_VOLUME_CAP)) { - mixeng_volume (sw->buf, ret, &sw->vol); - } + mixeng_volume (sw->buf, ret, &sw->vol); sw->clip (buf, sw->buf, ret); sw->total_hw_samples_acquired += total; @@ -1031,10 +1029,7 @@ int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int size) swlim = audio_MIN (swlim, samples); if (swlim) { sw->conv (sw->buf, buf, swlim); - - if (!(sw->hw->ctl_caps & VOICE_VOLUME_CAP)) { - mixeng_volume (sw->buf, swlim, &sw->vol); - } + mixeng_volume (sw->buf, swlim, &sw->vol); } while (swlim) { diff --git a/audio/audio_int.h b/audio/audio_int.h index b9b0676..117f95e 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -82,7 +82,6 @@ typedef struct HWVoiceOut { int samples; QLIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head; QLIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head; - int ctl_caps; struct audio_pcm_ops *pcm_ops; QLIST_ENTRY (HWVoiceOut) entries; } HWVoiceOut; @@ -102,7 +101,6 @@ typedef struct HWVoiceIn { int samples; QLIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head; - int ctl_caps; struct audio_pcm_ops *pcm_ops; QLIST_ENTRY (HWVoiceIn) entries; } HWVoiceIn; @@ -152,7 +150,6 @@ struct audio_driver { int max_voices_in; int voice_size_out; int voice_size_in; - int ctl_caps; }; struct audio_pcm_ops { @@ -236,8 +233,6 @@ void audio_run (const char *msg); #define VOICE_DISABLE 2 #define VOICE_VOLUME 3 -#define VOICE_VOLUME_CAP (1 << VOICE_VOLUME) - static inline int audio_ring_dist (int dst, int src, int len) { return (dst >= src) ? (dst - src) : (len - src + dst); diff --git a/audio/audio_template.h b/audio/audio_template.h index 571cf33..2f5224b 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -267,8 +267,6 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as) } hw->pcm_ops = drv->pcm_ops; - hw->ctl_caps = drv->ctl_caps; - QLIST_INIT (&hw->sw_head); #ifdef DAC QLIST_INIT (&hw->cap_head); -- 1.7.11.7