From 796217917abc9ce818cacaa65605913da45fa27a Mon Sep 17 00:00:00 2001 From: danguanghua Date: Tue, 8 Dec 2020 14:01:44 +0800 Subject: [PATCH] fix build break with CONFIG_AUDIO_MULTI_SESSION enabled N/A Change-Id: Idfa87031e09f26bd4ca57b5c220ce0ca849f80c4 Signed-off-by: danguanghua --- 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 1218033720..5700d79a88 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 643c08caa8..869eab05c7 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);