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-07 11:16:26 +0100 |
commit | ca638334f31f6cafab1bd1eb603710256eb9bc87 (patch) | |
tree | 42b2de6eb46bdd8e3d90d9a83f72db4651ac7f54 /plugins | |
parent | 03aa71cc492bd1202e71b7570c94f650c347702f (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 fbc8aa3..f80b1e4 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; } |