diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-22 16:16:39 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-22 16:16:39 +0000 |
commit | d021f6b042e6245f70c688bdb4f7e12029346dc6 (patch) | |
tree | aaa909dd24e905cf2fb5cc1f1a109de4f38ddeae /src | |
parent | d171fe9a2f016899f7a05916382e89fbb7c3869e (diff) | |
download | mpd-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
Diffstat (limited to '')
-rw-r--r-- | src/audio.c | 9 |
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; |