xiaoxiang781216 commented on code in PR #7717:
URL: https://github.com/apache/nuttx/pull/7717#discussion_r1036119910


##########
arch/sim/src/sim/sim_alsa.c:
##########
@@ -578,7 +690,20 @@ static void sim_audio_process(struct sim_audio_s *priv)
 
   if (priv->playback)
     {
-      ret = snd_pcm_writei(priv->pcm, apb->samp, expect);
+      out = malloc(expect * priv->frame_size);
+      if (out == NULL)
+        {
+          return;
+        }
+
+      ret = priv->ops->process(priv->codec, apb->samp, apb->nbytes,
+                               out, &outsize);
+      if (ret < 0)
+        {
+          goto dec_error;
+        }
+
+      ret = snd_pcm_writei(priv->pcm, out, expect);
     }
   else

Review Comment:
   should we call process after snd_pcm_readi too?



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

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

Reply via email to