aboutsummaryrefslogtreecommitdiff
path: root/audio/alsaaudio.c
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2009-10-03 03:30:06 +0400
committermalc <av1474@comtv.ru>2009-10-03 03:30:18 +0400
commita628b869be2ff8a404b43029e3e56919ce2e3c29 (patch)
treeac00638f4d77aae6ea1af96fb70f5fb696d18ec6 /audio/alsaaudio.c
parentcbc18261ea62ade74c1c92cddf2a66701822ad59 (diff)
oss/alsa: Do not invoke UB described in 7.15.1.1 (this time for ADC)
Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'audio/alsaaudio.c')
-rw-r--r--audio/alsaaudio.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 0ef89e98e6..7698d1010b 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -1079,23 +1079,26 @@ static int alsa_read (SWVoiceIn *sw, void *buf, int size)
static int alsa_ctl_in (HWVoiceIn *hw, int cmd, ...)
{
- va_list ap;
- int poll_mode;
ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;
- va_start (ap, cmd);
- poll_mode = va_arg (ap, int);
- va_end (ap);
-
switch (cmd) {
case VOICE_ENABLE:
- ldebug ("enabling voice\n");
- if (poll_mode && alsa_poll_in (hw)) {
- poll_mode = 0;
- }
- hw->poll_mode = poll_mode;
+ {
+ va_list ap;
+ int poll_mode;
- return alsa_voice_ctl (alsa->handle, "capture", 0);
+ va_start (ap, cmd);
+ poll_mode = va_arg (ap, int);
+ va_end (ap);
+
+ ldebug ("enabling voice\n");
+ if (poll_mode && alsa_poll_in (hw)) {
+ poll_mode = 0;
+ }
+ hw->poll_mode = poll_mode;
+
+ return alsa_voice_ctl (alsa->handle, "capture", 0);
+ }
case VOICE_DISABLE:
ldebug ("disabling voice\n");