summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2011-11-16 01:48:32 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2011-11-16 01:48:32 (GMT)
commitcda928f41dad4fbdc29396247aed49fc344c19f5 (patch)
treef37527d4b81711098aae93e730227c8b9395f2e2
parent7010e3f65e3e51b2b93f586679b1ae5785053098 (diff)
Allows to change the ALSA buffer size
In what is likely an ALSA bug, sometimes requiring 500ms buffer fails. Add a ALSABufferOverride parameter that allows to override the value. Value is in milliseconds.
-rw-r--r--mythtv/libs/libmyth/audio/audiooutputalsa.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/mythtv/libs/libmyth/audio/audiooutputalsa.cpp b/mythtv/libs/libmyth/audio/audiooutputalsa.cpp
index 63c5057..7b520f3 100644
--- a/mythtv/libs/libmyth/audio/audiooutputalsa.cpp
+++ b/mythtv/libs/libmyth/audio/audiooutputalsa.cpp
@@ -430,7 +430,9 @@ bool AudioOutputALSA::OpenDevice()
return false;
}
- buffer_time = 500000; // buffer 0.5s worth of samples
+ // buffer 0.5s worth of samples
+ buffer_time = gCoreContext->GetNumSetting("ALSABufferOverride", 500) * 1000;
+
period_time = 4; // aim for an interrupt every (1/4th of buffer_time)
err = SetParameters(pcm_handle, format, channels, samplerate,