You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/05/17 17:06:41 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9308: sim/sim_alsa: modify buffer_size in GET_BUFFERINFO when offload capture.

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


##########
arch/sim/src/sim/posix/sim_alsa.c:
##########
@@ -581,6 +585,12 @@ static int sim_audio_ioctl(struct audio_lowerhalf_s *dev, int cmd,
 
           info->nbuffers    = priv->nbuffers;
           info->buffer_size = priv->buffer_size;
+
+          if (!priv->playback && priv->ops->get_samples)

Review Comment:
   why check playback flag



##########
arch/sim/src/sim/posix/sim_alsa.c:
##########
@@ -581,6 +585,12 @@ static int sim_audio_ioctl(struct audio_lowerhalf_s *dev, int cmd,
 
           info->nbuffers    = priv->nbuffers;
           info->buffer_size = priv->buffer_size;
+
+          if (!priv->playback && priv->ops->get_samples)
+            {
+              info->buffer_size = priv->ops->get_samples(priv->codec) *

Review Comment:
   should we use MIN here?



-- 
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-unsubscribe@nuttx.apache.org

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