aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-22 16:16:39 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-22 16:16:39 +0000
commitd021f6b042e6245f70c688bdb4f7e12029346dc6 (patch)
treeaaa909dd24e905cf2fb5cc1f1a109de4f38ddeae
parentd171fe9a2f016899f7a05916382e89fbb7c3869e (diff)
downloadmpd-d021f6b042e6245f70c688bdb4f7e12029346dc6.tar.gz
mpd-d021f6b042e6245f70c688bdb4f7e12029346dc6.tar.xz
mpd-d021f6b042e6245f70c688bdb4f7e12029346dc6.zip
this really fixes pause
git-svn-id: https://svn.musicpd.org/mpd/trunk@2294 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/audio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/audio.c b/src/audio.c
index 79645244d..d5619e963 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -35,6 +35,8 @@ static AudioOutput * aoOutput = NULL;
static AudioOutput * shoutOutput = NULL;
static void copyAudioFormat(AudioFormat * dest, AudioFormat * src) {
+ if(!src) return;
+
dest->sampleRate = src->sampleRate;
dest->bits = src->bits;
dest->channels = src->channels;
@@ -150,10 +152,9 @@ int isCurrentAudioFormat(AudioFormat * audioFormat) {
int openAudioDevice(AudioFormat * audioFormat) {
if(!aoOutput->open || !isCurrentAudioFormat(audioFormat)) {
- if(!audioFormat) return -1;
- copyAudioFormat(&audio_format, audioFormat);
- if(shoutOutput) openAudioOutput(shoutOutput, audioFormat);
- return openAudioOutput(aoOutput, audioFormat);
+ if(audioFormat) copyAudioFormat(&audio_format, audioFormat);
+ if(shoutOutput) openAudioOutput(shoutOutput, &audio_format);
+ return openAudioOutput(aoOutput, &audio_format);
}
return 0;