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
This commit is contained in:
J. Alexander Treuman 2007-04-03 20:22:10 +00:00
parent 2caf18ad43
commit 059494e8e4

View File

@ -222,18 +222,18 @@ static int decodeSeek(PlayerControl * pc, DecoderControl * dc,
pause = !pause; \ pause = !pause; \
if (pause) pc->state = PLAYER_STATE_PAUSE; \ if (pause) pc->state = PLAYER_STATE_PAUSE; \
else { \ else { \
if (openAudioDevice(NULL) < 0) { \ if (openAudioDevice(NULL) >= 0) pc->state = PLAYER_STATE_PLAY; \
else { \
pathcpy_trunc(pc->erroredUrl, pc->utf8url); \ pathcpy_trunc(pc->erroredUrl, pc->utf8url); \
pc->error = PLAYER_ERROR_AUDIO; \ pc->error = PLAYER_ERROR_AUDIO; \
ERROR("problems opening audio device while playing \"%s\"\n", pc->utf8url); \ ERROR("problems opening audio device while playing \"%s\"\n", pc->utf8url); \
quitDecode(pc, dc); \ pause = -1; \
return; \
} \ } \
pc->state = PLAYER_STATE_PLAY; \
} \ } \
pc->pause = 0; \ pc->pause = 0; \
kill(getppid(), SIGUSR1); \ kill(getppid(), SIGUSR1); \
if (pause) { \ if (pause == -1) pause = 1; \
else if (pause) { \
dropBufferedAudio(); \ dropBufferedAudio(); \
closeAudioDevice(); \ closeAudioDevice(); \
} \ } \