mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
dmix: actually rewind when running or being drained
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
e59ffbf30e
commit
9a56a673a6
1 changed files with 6 additions and 2 deletions
|
|
@ -669,11 +669,15 @@ static snd_pcm_sframes_t snd_pcm_dmix_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t f
|
||||||
snd_pcm_direct_t *dmix = pcm->private_data;
|
snd_pcm_direct_t *dmix = pcm->private_data;
|
||||||
snd_pcm_uframes_t slave_appl_ptr, slave_size;
|
snd_pcm_uframes_t slave_appl_ptr, slave_size;
|
||||||
snd_pcm_uframes_t appl_ptr, size, transfer, result;
|
snd_pcm_uframes_t appl_ptr, size, transfer, result;
|
||||||
|
int err;
|
||||||
const snd_pcm_channel_area_t *src_areas, *dst_areas;
|
const snd_pcm_channel_area_t *src_areas, *dst_areas;
|
||||||
|
|
||||||
if (dmix->state == SND_PCM_STATE_RUNNING ||
|
if (dmix->state == SND_PCM_STATE_RUNNING ||
|
||||||
dmix->state == SND_PCM_STATE_DRAINING)
|
dmix->state == SND_PCM_STATE_DRAINING) {
|
||||||
return snd_pcm_dmix_hwsync(pcm);
|
err = snd_pcm_dmix_hwsync(pcm);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
if (dmix->last_appl_ptr < dmix->appl_ptr)
|
if (dmix->last_appl_ptr < dmix->appl_ptr)
|
||||||
size = dmix->appl_ptr - dmix->last_appl_ptr;
|
size = dmix->appl_ptr - dmix->last_appl_ptr;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue