mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 18:27:56 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user