From 4ca24f22f191033e5dbb88f34e4088bc2814ed0f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 1 Dec 2008 22:37:05 +0100 Subject: alsa: reverted the default buffer_time to 500 ms Commit dd7711d8 removed MPD's default ALSA buffer_time. The result was a buffer size which was way too small for playing streams on some sound hardware, and caused skips and distorted sound. Revert the default to 500 ms. --- src/output/alsa_plugin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c index a7f37f139..e5ac61088 100644 --- a/src/output/alsa_plugin.c +++ b/src/output/alsa_plugin.c @@ -28,6 +28,10 @@ static const char default_device[] = "default"; +enum { + MPD_ALSA_BUFFER_TIME_US = 500000, +}; + #define MPD_ALSA_RETRY_NR 5 typedef snd_pcm_sframes_t alsa_writei_t(snd_pcm_t * pcm, const void *buffer, @@ -62,7 +66,7 @@ static AlsaData *newAlsaData(void) ret->pcmHandle = NULL; ret->writei = snd_pcm_writei; ret->useMmap = 0; - ret->buffer_time = 0; + ret->buffer_time = MPD_ALSA_BUFFER_TIME_US; ret->period_time = 0; return ret; -- cgit v1.2.3