From 540f78f0bdf3d065b9b4620aaa16c57e227c7ef1 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sat, 1 Jan 2011 11:37:31 +0100 Subject: [PATCH] $mixer: report more reasonable values for mono devices --- src/mixer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mixer.c b/src/mixer.c index 17a71694..e29a1bcb 100644 --- a/src/mixer.c +++ b/src/mixer.c @@ -52,6 +52,7 @@ static int mixer_fd; static const char *devs[] = SOUND_DEVICE_NAMES; +static int stereo_flags; int mixer_init(const char *name) { @@ -70,6 +71,8 @@ int mixer_init(const char *name) } } + ioctl(mixer_fd, SOUND_MIXER_READ_STEREODEVS, &stereo_flags); + for (i = 0; i < sizeof(devs) / sizeof(const char *); i++) { if (strcasecmp(devs[i], name) == 0) { return i; @@ -93,6 +96,11 @@ static int mixer_get(int i) } rep = 0; + if(!(stereo_flags & (1<