参照元†
- struct snd_pcm_substream *substream
- struct snd_pcm_runtime *runtime
返り値†
static int snd_pcm_update_hw_ptr_post(struct snd_pcm_substream *substream,
struct snd_pcm_runtime *runtime)
{
snd_pcm_uframes_t avail;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
avail = snd_pcm_playback_avail(runtime);
else
avail = snd_pcm_capture_avail(runtime);
if (avail > runtime->avail_max)
runtime->avail_max = avail;
if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
if (avail >= runtime->buffer_size) {
snd_pcm_drain_done(substream);
return -EPIPE;
}
} else {
if (avail >= runtime->stop_threshold) {
xrun(substream);
return -EPIPE;
}
}
if (avail >= runtime->control->avail_min)
wake_up(&runtime->sleep);
return 0;
}
コメント†