mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
dmix skipping first set of samples
There was a change in alsa-lib 1.0.16 which looks like it was designed to make dmix skip samples in the case of underruns, but it causes the first sample to be skipped since dmix->slave_hw_ptr == dmix->slave_appl_ptr. The following patch fixes this and fixes a small typo in the comment. From: Mike Gorse <mgorse@mgorse.dhs.org>
This commit is contained in:
parent
d587383d6b
commit
fe8bb13400
1 changed files with 2 additions and 2 deletions
|
|
@ -311,9 +311,9 @@ static void snd_pcm_dmix_sync_area(snd_pcm_t *pcm)
|
||||||
if (size >= pcm->boundary / 2)
|
if (size >= pcm->boundary / 2)
|
||||||
size = pcm->boundary - size;
|
size = pcm->boundary - size;
|
||||||
|
|
||||||
/* the slave_app_ptr can be far behing the slave_hw_ptr */
|
/* the slave_app_ptr can be far behind the slave_hw_ptr */
|
||||||
/* reduce mixing and errors here - just skip not catched writes */
|
/* reduce mixing and errors here - just skip not catched writes */
|
||||||
if (dmix->slave_hw_ptr < dmix->slave_appl_ptr)
|
if (dmix->slave_hw_ptr <= dmix->slave_appl_ptr)
|
||||||
slave_size = dmix->slave_appl_ptr - dmix->slave_hw_ptr;
|
slave_size = dmix->slave_appl_ptr - dmix->slave_hw_ptr;
|
||||||
else
|
else
|
||||||
slave_size = dmix->slave_appl_ptr + (dmix->slave_boundary - dmix->slave_hw_ptr);
|
slave_size = dmix->slave_appl_ptr + (dmix->slave_boundary - dmix->slave_hw_ptr);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue