diff options
author | Thierry Bultel <thierry.bultel@iot.bzh> | 2018-11-06 13:36:22 +0100 |
---|---|---|
committer | Thierry Bultel <thierry.bultel@iot.bzh> | 2018-11-06 13:36:22 +0100 |
commit | 6bf855f264d8a89339124961bda40ecd40523ec8 (patch) | |
tree | 1b0af8d5cfe011089b00e0bd68c6189a2c5df2e3 /plugins | |
parent | a07c4ca8162affc61a5b0e5db8485f0753cd465b (diff) |
alsa-core-pcm: fixed the mute logic
This fixes the mute/unmute logic. This was broken due to
a forgotten push for a commit
Change-Id: I6cbdedefc11ebd508d30ece71df364d9b69c74f0
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/alsa/alsa-core-pcm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/alsa/alsa-core-pcm.c b/plugins/alsa/alsa-core-pcm.c index 1205a81..acea09b 100644 --- a/plugins/alsa/alsa-core-pcm.c +++ b/plugins/alsa/alsa-core-pcm.c @@ -454,8 +454,8 @@ static int suspend( snd_pcm_t * pcm, int error) static void readSuspend(AlsaPcmCopyHandleT * pcmCopyHandle) { // will be deaf - pcmCopyHandle->saveFd = pcmCopyHandle->pollFds[0].fd; - pcmCopyHandle->pollFds[0].fd = -1; + pcmCopyHandle->saveFd = pcmCopyHandle->pollFds[1].fd; + pcmCopyHandle->pollFds[1].fd = -1; AFB_ApiNotice(pcmCopyHandle->api, "capture muted"); } @@ -463,7 +463,9 @@ static void readSuspend(AlsaPcmCopyHandleT * pcmCopyHandle) { static void readResume(AlsaPcmCopyHandleT * pcmCopyHandle) { // undeaf it - pcmCopyHandle->pollFds[0].fd = pcmCopyHandle->saveFd; + pcmCopyHandle->pollFds[1].fd = pcmCopyHandle->saveFd; + snd_pcm_prepare(pcmCopyHandle->pcmIn->handle); + snd_pcm_start(pcmCopyHandle->pcmIn->handle); AFB_ApiNotice(pcmCopyHandle->api, "capture unmuted"); } @@ -500,7 +502,7 @@ static void *readThreadEntry(void *handle) { if (err == 0) { /* timeout */ - AFB_ApiDebug(pcmCopyHandle->api, "%s(%s) alive", __func__, pcmCopyHandle->pcmIn->cid.cardid ); + AFB_ApiDebug(pcmCopyHandle->api, "%s(%s) alive, mute %d", __func__, pcmCopyHandle->pcmIn->cid.cardid, muted ); continue; } |