mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
AlsaOut tweaks. Must finish handling errors in that...
This commit is contained in:
parent
afda2bda0e
commit
a92bfb32d2
@ -44,9 +44,9 @@ AlsaOut::AlsaOut()
|
||||
std::cerr << "AlsaOut::AlsaOut() called" << std::endl;
|
||||
#endif
|
||||
int err;
|
||||
if ((err = snd_pcm_open (&waveHandle, 0, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
|
||||
std::cerr << "AlsaOut: cannot open audio device 0" << snd_strerror(err) << std::endl;
|
||||
exit (1);
|
||||
if ((err = snd_pcm_open (&waveHandle, "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
|
||||
std::cerr << "AlsaOut: cannot open audio device 'default' :" << snd_strerror(err) << std::endl;
|
||||
return;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
else {
|
||||
|
@ -79,6 +79,10 @@ bool AlsaOutBuffer::AddToOutput(){
|
||||
}*/
|
||||
int err;
|
||||
snd_pcm_t* wHandle = waveOut->getWaveHandle();
|
||||
if (wHandle == NULL) {
|
||||
printf("Error. No device handle \n");
|
||||
return false;
|
||||
}
|
||||
frames = snd_pcm_writei(wHandle, (void*)data, bufferLength);
|
||||
if (frames < 0)
|
||||
frames = snd_pcm_recover(wHandle, frames, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user