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


The following commit(s) were added to refs/heads/master by this push:
     new 7962179  fix build break with CONFIG_AUDIO_MULTI_SESSION enabled
7962179 is described below

commit 796217917abc9ce818cacaa65605913da45fa27a
Author: danguanghua <danguang...@xiaomi.com>
AuthorDate: Tue Dec 8 14:01:44 2020 +0800

    fix build break with CONFIG_AUDIO_MULTI_SESSION enabled
    
    N/A
    
    Change-Id: Idfa87031e09f26bd4ca57b5c220ce0ca849f80c4
    Signed-off-by: danguanghua <danguang...@xiaomi.com>
---
 arch/sim/src/sim/up_alsa.c | 24 ++++++++++++++++++++++++
 audio/audio.c              |  2 +-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/sim/src/sim/up_alsa.c b/arch/sim/src/sim/up_alsa.c
index 1218033..5700d79 100644
--- a/arch/sim/src/sim/up_alsa.c
+++ b/arch/sim/src/sim/up_alsa.c
@@ -68,8 +68,14 @@ struct sim_audio_s
 
 static int sim_audio_getcaps(struct audio_lowerhalf_s *dev, int type,
                              struct audio_caps_s *caps);
+#ifdef CONFIG_AUDIO_MULTI_SESSION
 static int sim_audio_configure(struct audio_lowerhalf_s *dev,
+                               FAR void *session,
                                const struct audio_caps_s *caps);
+#else
+static int sim_audio_configure(struct audio_lowerhalf_s *dev,
+                               const struct audio_caps_s *caps);
+#endif
 static int sim_audio_shutdown(struct audio_lowerhalf_s *dev);
 static int sim_audio_start(struct audio_lowerhalf_s *dev);
 #ifndef CONFIG_AUDIO_EXCLUDE_STOP
@@ -353,8 +359,14 @@ static int sim_audio_getcaps(struct audio_lowerhalf_s 
*dev, int type,
   return caps->ac_len;
 }
 
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int sim_audio_configure(struct audio_lowerhalf_s *dev,
+                               FAR void *session,
+                               const struct audio_caps_s *caps)
+#else
 static int sim_audio_configure(struct audio_lowerhalf_s *dev,
                                const struct audio_caps_s *caps)
+#endif
 {
   struct sim_audio_s *priv = (struct sim_audio_s *)dev;
   int ret = 0;
@@ -421,10 +433,18 @@ static int sim_audio_stop(struct audio_lowerhalf_s *dev)
       struct ap_buffer_s *apb;
 
       apb = (struct ap_buffer_s *)dq_remfirst(&priv->pendq);
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+      priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK, NULL);
+#else
       priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK);
+#endif
     }
 
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+  priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_COMPLETE, NULL, OK, NULL);
+#else
   priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_COMPLETE, NULL, OK);
+#endif
 
   return 0;
 }
@@ -576,7 +596,11 @@ static void sim_audio_process(struct sim_audio_s *priv)
           final = true;
         }
 
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+      priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK, NULL);
+#else
       priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK);
+#endif
 
       if (final)
         {
diff --git a/audio/audio.c b/audio/audio.c
index 643c08c..869eab0 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -808,7 +808,7 @@ static inline void audio_message(FAR struct 
audio_upperhalf_s *upper,
   if (upper->usermq != NULL)
     {
 #ifdef CONFIG_AUDIO_MULTI_SESSION
-      msg.session = session;
+      msg->session = session;
 #endif
       nxmq_send(upper->usermq, (FAR const char *)msg, sizeof(*msg),
                 CONFIG_AUDIO_BUFFER_DEQUEUE_PRIO);

Reply via email to