diff options
author | J. Alexander Treuman <jat@spatialrift.net> | 2007-04-03 20:22:10 +0000 |
---|---|---|
committer | J. Alexander Treuman <jat@spatialrift.net> | 2007-04-03 20:22:10 +0000 |
commit | 059494e8e482bd974c011111e6f650cbae43a2f7 (patch) | |
tree | 084ae741e1b433362fa3a0a225a6e2e0b3182adf /src/decode.c | |
parent | 2caf18ad433791b5738f95121feadc0c74cd6ad7 (diff) | |
download | mpd-059494e8e482bd974c011111e6f650cbae43a2f7.tar.gz mpd-059494e8e482bd974c011111e6f650cbae43a2f7.tar.xz mpd-059494e8e482bd974c011111e6f650cbae43a2f7.zip |
Don't stop decoding when unpausing fails because no audio device can be
opened. Instead just remain in paused state.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5820 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/decode.c')
-rw-r--r-- | src/decode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/decode.c b/src/decode.c index 625a40523..349ef48f3 100644 --- a/src/decode.c +++ b/src/decode.c @@ -222,18 +222,18 @@ static int decodeSeek(PlayerControl * pc, DecoderControl * dc, pause = !pause; \ if (pause) pc->state = PLAYER_STATE_PAUSE; \ else { \ - if (openAudioDevice(NULL) < 0) { \ + if (openAudioDevice(NULL) >= 0) pc->state = PLAYER_STATE_PLAY; \ + else { \ pathcpy_trunc(pc->erroredUrl, pc->utf8url); \ pc->error = PLAYER_ERROR_AUDIO; \ ERROR("problems opening audio device while playing \"%s\"\n", pc->utf8url); \ - quitDecode(pc, dc); \ - return; \ + pause = -1; \ } \ - pc->state = PLAYER_STATE_PLAY; \ } \ pc->pause = 0; \ kill(getppid(), SIGUSR1); \ - if (pause) { \ + if (pause == -1) pause = 1; \ + else if (pause) { \ dropBufferedAudio(); \ closeAudioDevice(); \ } \ |