mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-15 07:00:02 -05:00
Added snd_pcm_hwptr() and enhanced snd_pcm_mmap_begin() for no xrun mode.
This commit is contained in:
parent
a91efc0fe6
commit
fbd99fdec0
17 changed files with 231 additions and 13 deletions
|
|
@ -185,6 +185,24 @@ static int snd_pcm_jack_hwsync(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int snd_pcm_jack_hwptr(snd_pcm_t *pcm, snd_pcm_uframes_t *hwptr)
|
||||
{
|
||||
#ifdef PCM_JACK_DEBUG
|
||||
printf("snd_pcm_jack_hwptr\n"); fflush(stdout);
|
||||
#endif
|
||||
switch (snd_pcm_state(pcm)) {
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
case SND_PCM_STATE_DRAINING:
|
||||
case SND_PCM_STATE_PREPARED:
|
||||
case SND_PCM_STATE_PAUSED:
|
||||
case SND_PCM_STATE_SUSPENDED:
|
||||
*hwptr = *pcm->hw.ptr;
|
||||
return 0;
|
||||
default:
|
||||
return -EBADFD;
|
||||
}
|
||||
}
|
||||
|
||||
static int snd_pcm_jack_delay(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sframes_t *delayp)
|
||||
{
|
||||
#ifdef PCM_JACK_DEBUG
|
||||
|
|
@ -593,6 +611,7 @@ static snd_pcm_fast_ops_t snd_pcm_jack_fast_ops = {
|
|||
status: snd_pcm_jack_status,
|
||||
state: snd_pcm_jack_state,
|
||||
hwsync: snd_pcm_jack_hwsync,
|
||||
hwptr: snd_pcm_jack_hwptr,
|
||||
delay: snd_pcm_jack_delay,
|
||||
prepare: snd_pcm_jack_prepare,
|
||||
reset: snd_pcm_jack_reset,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue