aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-11-28 09:12:30 -0800
committerChris Robinson <[email protected]>2011-11-28 09:12:30 -0800
commitdfd02817fafb39ce7e6d5cb41a95facd9fd910ff (patch)
tree146a5491b64eee294173eff7bd36a4670643a73f /Alc/backends
parent222d2363cdcbe563eb0a96b2b9c032ade062762f (diff)
Make ALSA XRUN when the number of available samples exceeds the buffer size
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/alsa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c
index b99fd147..85e1d802 100644
--- a/Alc/backends/alsa.c
+++ b/Alc/backends/alsa.c
@@ -64,6 +64,7 @@ MAKE_FUNC(snd_pcm_hw_params);
MAKE_FUNC(snd_pcm_sw_params_malloc);
MAKE_FUNC(snd_pcm_sw_params_current);
MAKE_FUNC(snd_pcm_sw_params_set_avail_min);
+MAKE_FUNC(snd_pcm_sw_params_set_stop_threshold);
MAKE_FUNC(snd_pcm_sw_params);
MAKE_FUNC(snd_pcm_sw_params_free);
MAKE_FUNC(snd_pcm_prepare);
@@ -126,6 +127,7 @@ MAKE_FUNC(snd_card_next);
#define snd_pcm_sw_params_malloc psnd_pcm_sw_params_malloc
#define snd_pcm_sw_params_current psnd_pcm_sw_params_current
#define snd_pcm_sw_params_set_avail_min psnd_pcm_sw_params_set_avail_min
+#define snd_pcm_sw_params_set_stop_threshold psnd_pcm_sw_params_set_stop_threshold
#define snd_pcm_sw_params psnd_pcm_sw_params
#define snd_pcm_sw_params_free psnd_pcm_sw_params_free
#define snd_pcm_prepare psnd_pcm_prepare
@@ -206,6 +208,7 @@ static ALCboolean alsa_load(void)
LOAD_FUNC(snd_pcm_sw_params_malloc);
LOAD_FUNC(snd_pcm_sw_params_current);
LOAD_FUNC(snd_pcm_sw_params_set_avail_min);
+ LOAD_FUNC(snd_pcm_sw_params_set_stop_threshold);
LOAD_FUNC(snd_pcm_sw_params);
LOAD_FUNC(snd_pcm_sw_params_free);
LOAD_FUNC(snd_pcm_prepare);
@@ -726,6 +729,8 @@ static ALCboolean alsa_reset_playback(ALCdevice *device)
err = "sw current";
if(i == 0 && (i=snd_pcm_sw_params_set_avail_min(data->pcmHandle, sp, periodSizeInFrames)) != 0)
err = "sw set avail min";
+ if(i == 0 && (i=snd_pcm_sw_params_set_stop_threshold(data->pcmHandle, sp, periodSizeInFrames*periods)) != 0)
+ err = "sw set stop threshold";
if(i == 0 && (i=snd_pcm_sw_params(data->pcmHandle, sp)) != 0)
err = "sw set params";
if(i != 0)