Permalink
Browse files

Try to increase ALSA bugger by 64kB block

  • Loading branch information...
1 parent 1b25aae commit f6af8c73c81fabc1796b3e9a0f865c9e723a4e6a @jyavenard jyavenard committed Dec 15, 2010
Showing with 12 additions and 7 deletions.
  1. +12 −7 mythtv/libs/libmyth/audiooutputalsa.cpp
View
19 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();

0 comments on commit f6af8c7

Please sign in to comment.