aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-20 17:11:04 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-20 17:11:04 +0000
commitfd2ae556a241c40974ad34eb18556adc0f2f5977 (patch)
tree98dc86bfdb636b89bc9a5f93c0d27995882439db /src/audio.c
parentf4d75d7596c02ed1cc6ff30310268eacfc6e75a8 (diff)
downloadmpd-fd2ae556a241c40974ad34eb18556adc0f2f5977.tar.gz
mpd-fd2ae556a241c40974ad34eb18556adc0f2f5977.tar.xz
mpd-fd2ae556a241c40974ad34eb18556adc0f2f5977.zip
some small cleanups
git-svn-id: https://svn.musicpd.org/mpd/trunk@2280 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/audio.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/audio.c b/src/audio.c
index 77fe9c25b..446eff40e 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -136,18 +136,15 @@ void finishAudioDriver() {
}
int isCurrentAudioFormat(AudioFormat * audioFormat) {
- if(!aoOutput || !audioFormat) return 0;
+ if(!audioFormat) return 0;
if(memcmp(audioFormat,&audio_format,sizeof(AudioFormat)) != 0) return 0;
+
return 1;
}
int openAudioDevice(AudioFormat * audioFormat) {
- if(aoOutput->open && !isCurrentAudioFormat(audioFormat)) {
- closeAudioOutput(aoOutput);
- }
-
- if(!aoOutput->open) {
+ if(!aoOutput->open || !isCurrentAudioFormat(audioFormat)) {
return openAudioOutput(aoOutput, audioFormat);
}
@@ -155,11 +152,6 @@ int openAudioDevice(AudioFormat * audioFormat) {
}
int playAudio(char * playChunk, int size) {
- if(!aoOutput->open) {
- ERROR("trying to play w/o the audio device being open!\n");
- return -1;
- }
-
return playAudioOutput(aoOutput, playChunk, size);
}
@@ -168,7 +160,5 @@ int isAudioDeviceOpen() {
}
void closeAudioDevice() {
- if(aoOutput->open) {
- closeAudioOutput(aoOutput);
- }
+ closeAudioOutput(aoOutput);
}