diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/audio.c | 27 | ||||
-rw-r--r-- | src/audio.h | 2 | ||||
-rw-r--r-- | src/audioOutput_ao.c | 14 |
3 files changed, 26 insertions, 17 deletions
diff --git a/src/audio.c b/src/audio.c index 605bf796e..a03872709 100644 --- a/src/audio.c +++ b/src/audio.c @@ -250,6 +250,19 @@ int openAudioDevice(AudioFormat * audioFormat) { return 0; } +void audioError() { +#ifdef HAVE_AUDIO + if(errno==AO_ENOTLIVE) { + ERROR("not a live ao device\n"); + } + else if(errno==AO_EOPENDEVICE) { + ERROR("not able to open audio device\n"); + } + else if(errno==AO_EBADOPTION) { + ERROR("bad driver option\n"); + } +#endif +} int playAudio(char * playChunk, int size) { #ifdef HAVE_AUDIO @@ -293,17 +306,3 @@ void closeAudioDevice() { } #endif } - -void audioError() { -#ifdef HAVE_AUDIO - if(errno==AO_ENOTLIVE) { - ERROR("not a live ao device\n"); - } - else if(errno==AO_EOPENDEVICE) { - ERROR("not able to open audio device\n"); - } - else if(errno==AO_EBADOPTION) { - ERROR("bad driver option\n"); - } -#endif -} diff --git a/src/audio.h b/src/audio.h index b86f832fb..478b6946e 100644 --- a/src/audio.h +++ b/src/audio.h @@ -51,8 +51,6 @@ void closeAudioDevice(); int isAudioDeviceOpen(); -void audioError(); - int isCurrentAudioFormat(AudioFormat * audioFormat); #endif diff --git a/src/audioOutput_ao.c b/src/audioOutput_ao.c index 023b7f4a9..6db54f2a5 100644 --- a/src/audioOutput_ao.c +++ b/src/audioOutput_ao.c @@ -44,6 +44,18 @@ static AoData * newAoData() { return ret; } +static void audioOutputAo_error() { + if(errno==AO_ENOTLIVE) { + ERROR("not a live ao device\n"); + } + else if(errno==AO_EOPENDEVICE) { + ERROR("not able to open audio device\n"); + } + else if(errno==AO_EBADOPTION) { + ERROR("bad driver option\n"); + } +} + static void audioOutputAo_initDriver(AudioOutput * audioOutput) { ao_info * ai; char * dup; @@ -183,7 +195,7 @@ static int audioOutputAo_play(AudioOutput * audioOutput, char * playChunk, send = ad->writeSize > size ? size : ad->writeSize; if(ao_play(ad->device, playChunk, send)==0) { - audioError(); + audioOutputAo_error(); ERROR("closing audio device due to write error\n"); audioOutputAo_closeDevice(audioOutput); return -1; |