mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm: direct plugins - fix hw_ptr in the status callback
The parent hw_ptr may be in another range (boundary limit). Set the correct value for the caller. BugLink: https://github.com/alsa-project/alsa-lib/issues/155 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
212c6c18c4
commit
dd609ef968
3 changed files with 3 additions and 0 deletions
|
|
@ -491,6 +491,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
}
|
||||
|
||||
status->state = snd_pcm_dmix_state(pcm);
|
||||
status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */
|
||||
status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */
|
||||
status->trigger_tstamp = dmix->trigger_tstamp;
|
||||
status->avail = snd_pcm_mmap_playback_avail(pcm);
|
||||
|
|
|
|||
|
|
@ -243,6 +243,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
break;
|
||||
}
|
||||
status->state = snd_pcm_dshare_state(pcm);
|
||||
status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */
|
||||
status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */
|
||||
status->trigger_tstamp = dshare->trigger_tstamp;
|
||||
status->avail = snd_pcm_mmap_playback_avail(pcm);
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
snd_pcm_status(dsnoop->spcm, status);
|
||||
state = snd_pcm_state(dsnoop->spcm);
|
||||
status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state;
|
||||
status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */
|
||||
status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */
|
||||
status->trigger_tstamp = dsnoop->trigger_tstamp;
|
||||
status->avail = snd_pcm_mmap_capture_avail(pcm);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue