Skip to content

Commit

Permalink
Try to increase ALSA bugger by 64kB block
Browse files Browse the repository at this point in the history
  • Loading branch information
jyavenard committed Dec 15, 2010
1 parent 4bc2262 commit 0175201
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions mythtv/libs/libmyth/audio/audiooutputalsa.cpp
Expand Up @@ -242,21 +242,26 @@ bool AudioOutputALSA::IncPreallocBufferSize(int buffer_time)
int cur = pfile.readAll().trimmed().toInt(); int cur = pfile.readAll().trimmed().toInt();
int max = mfile.readAll().trimmed().toInt(); int max = mfile.readAll().trimmed().toInt();


int size = (samplerate / 1000) * int size = (((samplerate / 1000) *
(buffer_time / 1000) * (buffer_time / 1000) *
output_bytes_per_frame / 1024; output_bytes_per_frame / 1024) / 64 + 1) * 64;


VBAUDIO(QString("Prealloc buffer cur: %1 need: %2 max: %3") VBAUDIO(QString("Prealloc buffer cur: %1 need: %2 max: %3")
.arg(cur).arg(size).arg(max)); .arg(cur).arg(size).arg(max));


if (size > max) if(size == cur)
{ {
size = max; pfile.close();
mfile.close();
ret = false; ret = false;
return ret;
} }


if (!size) if (size > max || !size)
{
size = max;
ret = false; ret = false;
}


pfile.close(); pfile.close();
mfile.close(); mfile.close();
Expand Down

0 comments on commit 0175201

Please sign in to comment.