Module: wine Branch: master Commit: edff53387a2186a51834c7b03d48307b9e335293 URL: http://source.winehq.org/git/wine.git/?a=commit;h=edff53387a2186a51834c7b03d...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Jul 17 13:35:53 2007 +0200
winealsa: Make sure we can set volume before reporting WAVECAPS_VOLUME.
---
dlls/winealsa.drv/waveinit.c | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/winealsa.drv/waveinit.c b/dlls/winealsa.drv/waveinit.c index 11f8fdd..a19e332 100644 --- a/dlls/winealsa.drv/waveinit.c +++ b/dlls/winealsa.drv/waveinit.c @@ -307,10 +307,22 @@ static int ALSA_ComputeCaps(snd_ctl_t *ctl, snd_pcm_t *pcm,
/* check for volume control support */ if (ctl) { - *supports |= WAVECAPS_VOLUME; - - if (chmin <= 2 && 2 <= chmax) - *supports |= WAVECAPS_LRVOLUME; + if (snd_ctl_name(ctl)) + { + snd_hctl_t *hctl; + if (snd_hctl_open(&hctl, snd_ctl_name(ctl), 0) >= 0) + { + snd_hctl_load(hctl); + if (!ALSA_CheckSetVolume( hctl, NULL, NULL, NULL, NULL, NULL, NULL, NULL )) + { + *supports |= WAVECAPS_VOLUME; + if (chmin <= 2 && 2 <= chmax) + *supports |= WAVECAPS_LRVOLUME; + } + snd_hctl_free(hctl); + snd_hctl_close(hctl); + } + } }
if (*formats & (WAVE_FORMAT_1M08 | WAVE_FORMAT_2M08 |