fix build break with CONFIG_AUDIO_MULTI_SESSION enabled

N/A

Change-Id: Idfa87031e09f26bd4ca57b5c220ce0ca849f80c4
Signed-off-by: danguanghua <danguanghua@xiaomi.com>
This commit is contained in:
danguanghua 2020-12-08 14:01:44 +08:00 committed by Xiang Xiao
parent 73d4832c15
commit 796217917a
2 changed files with 25 additions and 1 deletions

View File

@ -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)
{

View File

@ -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);