You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/11/22 09:38:25 UTC

[incubator-nuttx] 05/07: drivers: audio: Don't stop cxd56 when stopped

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6735cf412e42e7cf3ce4e7372bd31d7eea7ff034
Author: Tobias Johansson <to...@sony.com>
AuthorDate: Wed Nov 17 14:16:56 2021 +0100

    drivers: audio: Don't stop cxd56 when stopped
    
    Avoid trying to stop the driver when already stopped.
    
    Signed-off-by: Tobias Johansson <to...@sony.com>
---
 drivers/audio/cxd56.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/audio/cxd56.c b/drivers/audio/cxd56.c
index 7cb9bb3..6fd645d 100644
--- a/drivers/audio/cxd56.c
+++ b/drivers/audio/cxd56.c
@@ -1291,8 +1291,9 @@ static void _process_audio_with_src(cxd56_dmahandle_t hdl, uint16_t err_code)
     {
       /* Notify end of data */
 
-      if (dev->state != CXD56_DEV_STATE_PAUSED
-          && dq_count(&dev->down_pendq) == 0)
+      if (dev->state != CXD56_DEV_STATE_PAUSED &&
+          dev->state != CXD56_DEV_STATE_STOPPED &&
+          dq_count(&dev->down_pendq) == 0)
         {
           msg.msg_id = AUDIO_MSG_STOP;
           msg.u.data = 0;
@@ -1393,7 +1394,8 @@ static void _process_audio(cxd56_dmahandle_t hdl, uint16_t err_code)
     {
       /* Notify end of data */
 
-      if (dev->state != CXD56_DEV_STATE_PAUSED)
+      if (dev->state != CXD56_DEV_STATE_PAUSED &&
+          dev->state != CXD56_DEV_STATE_STOPPED)
         {
           audinfo("DMA_TRANS up_pendq=%d \n",
                  dq_count(&dev->up_pendq));