summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2010-12-15 13:42:48 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-12-15 13:43:25 (GMT)
commitf6af8c73c81fabc1796b3e9a0f865c9e723a4e6a (patch)
treea2ab0b561453bf3b5dcc42a06d5a160248265691
parent1b25aaed574d6c995e9e751fd6173a1d5a8aa8ca (diff)
Try to increase ALSA bugger by 64kB block
-rw-r--r--mythtv/libs/libmyth/audiooutputalsa.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/mythtv/libs/libmyth/audiooutputalsa.cpp b/mythtv/libs/libmyth/audiooutputalsa.cpp
index 0397382..4875927 100644
--- a/mythtv/libs/libmyth/audiooutputalsa.cpp
+++ b/mythtv/libs/libmyth/audiooutputalsa.cpp
@@ -239,20 +239,25 @@ bool AudioOutputALSA::IncPreallocBufferSize(int buffer_time)
int cur = pfile.readAll().trimmed().toInt();
int max = mfile.readAll().trimmed().toInt();
- int size = (samplerate / 1000) *
- (buffer_time / 1000) *
- output_bytes_per_frame / 1024;
+ int size = (((samplerate / 1000) *
+ (buffer_time / 1000) *
+ output_bytes_per_frame / 1024) / 64 + 1) * 64;
VBAUDIO(QString("Prealloc buffer cur: %1 max: %3").arg(cur).arg(max));
- if (size > max)
+ if(size == cur)
{
- size = max;
+ pfile.close();
+ mfile.close();
ret = false;
+ return ret;
}
-
- if (!size)
+
+ if (size > max || !size)
+ {
+ size = max;
ret = false;
+ }
pfile.close();
mfile.close();