Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix ALSA buffer allocation.
Changing the audio buffer size only works when the audio device is closed. So close it before attempting to open it. This only works if myth has write access
  • Loading branch information
jyavenard committed Dec 14, 2010
1 parent 44b6ab2 commit 04c15e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mythtv/libs/libmyth/audio/audiooutputalsa.cpp
Expand Up @@ -180,6 +180,11 @@ bool AudioOutputALSA::SetPreallocBufferSize(int size)
if (GetPCMInfo(card, device, subdevice) < 0)
return false;

// We can not increase the size of the audio buffer while device is opened
// so make sure it is closed
if (pcm_handle != NULL)
CloseDevice();

QFile pfile(QString("/proc/asound/card%1/pcm%2p/sub%3/prealloc")
.arg(card).arg(device).arg(subdevice));

Expand Down

0 comments on commit 04c15e1

Please sign in to comment.