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:51:29 (GMT)
commit07b1cc13cd15d02ea00d7f183b43be176252b4af (patch)
tree625f279c7a7b3a12f6c093a3bd7f93aed0ee697c
parent088335b4bd8147a1f33aca8f7fb62a73fdc88e34 (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/audiooutputalsa.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/mythtv/libs/libmyth/audiooutputalsa.cpp b/mythtv/libs/libmyth/audiooutputalsa.cpp
index 2fe1846..2bc3dfa 100644
--- a/mythtv/libs/libmyth/audiooutputalsa.cpp
+++ b/mythtv/libs/libmyth/audiooutputalsa.cpp
@@ -427,7 +427,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,