1
0
Fork 0
forked from nuttx/nuttx-update

sim/sim_alsa.c: add paused variable instead of snd_pcm_pause.

snd_pcm_hw_params_can_pause return false on sim.
add paused variable to support pause.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
This commit is contained in:
qiaohaijiao1 2023-06-27 20:39:35 +08:00 committed by Xiang Xiao
parent 210c72a651
commit de5c35382a

View file

@ -48,6 +48,8 @@ struct sim_audio_s
bool playback;
bool offload;
bool paused;
uint32_t frame_size;
uint32_t nbuffers;
uint32_t buffer_size;
@ -529,8 +531,7 @@ static int sim_audio_pause(struct audio_lowerhalf_s *dev)
return 0;
}
snd_pcm_pause(priv->pcm, 0);
priv->paused = true;
return 0;
}
@ -543,8 +544,7 @@ static int sim_audio_resume(struct audio_lowerhalf_s *dev)
return 0;
}
snd_pcm_resume(priv->pcm);
priv->paused = false;
return 0;
}
#endif
@ -749,7 +749,7 @@ static void sim_audio_process(struct sim_audio_s *priv)
bool dequeue = false;
int ret = 0;
if (!priv->pcm)
if (!priv->pcm || priv->paused)
{
return;
}