masayuki2009 commented on a change in pull request #2282:
URL: https://github.com/apache/incubator-nuttx/pull/2282#discussion_r521976899



##########
File path: drivers/audio/cxd56.c
##########
@@ -1370,22 +1375,24 @@ static void cxd56_dma_int_handler(void)
 
       flags = spin_lock_irqsave();
 
-      if (dq_count(&dev->up_runq) > 0)
-        {
-          FAR struct ap_buffer_s *apb;
-
-          apb = (struct ap_buffer_s *) dq_get(&dev->up_runq);
-          spin_unlock_irqrestore(flags);
-          dev->dev.upper(dev->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK);
-          flags = spin_lock_irqsave();
-        }
-
-      spin_unlock_irqrestore(flags);
-
       if (err_code == CXD56_AUDIO_ECODE_DMA_TRANS)
         {
           /* Notify end of data */
 
+#ifdef CONFIG_AUDIO_CXD56_SRC
+          if (dev->state != CXD56_DEV_STATE_PAUSED

Review comment:
       I think  cxd56_dma_int_handler() has many lines and many #ifdefs, so 
it's not easy to read.
   Shall we separete the original (i.e. w/o SRC) code and new code (i.e w/ SRC)?
   
   e.g.
   
   ```
   sttic void cxd56_dma_int_handler(void)
   {
   ....
     if (err_code != CXD56_AUDIO_ECODE_DMA_HANDLE_INV)
       {
   #ifdef CONFIG_AUDIO_CXD56_SRC
         _process_audio_with_src(....);
   #else 
         _process_audio(...);
   #endif 
       }
   }




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to