mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 00:05:03 -05:00
[alsa] Don't query snd_pcm_delay() during an underrun
This commit is contained in:
parent
d2d52c7d68
commit
e65361ba17
@ -89,8 +89,6 @@ laudio_alsa_xrun_recover(int err)
|
||||
{
|
||||
DPRINTF(E_WARN, L_LAUDIO, "PCM buffer underrun\n");
|
||||
|
||||
pcm_last_error = 0;
|
||||
|
||||
ret = snd_pcm_prepare(hdl);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -263,6 +261,7 @@ laudio_alsa_write(uint8_t *buf, uint64_t rtptime)
|
||||
return;
|
||||
}
|
||||
|
||||
pcm_last_error = 0;
|
||||
pcm_pos += nsamp;
|
||||
|
||||
pkt->offset += STOB(nsamp);
|
||||
@ -293,6 +292,9 @@ laudio_alsa_get_pos(void)
|
||||
if (pcm_pos == 0)
|
||||
return 0;
|
||||
|
||||
if (pcm_last_error != 0)
|
||||
return pcm_pos;
|
||||
|
||||
ret = snd_pcm_delay(hdl, &delay);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user