From 70dbc2b0e76f479961bd0ac326ee6a5d009cc170 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 26 Mar 2008 10:38:58 +0000 Subject: send notify signal after SIGCONT When the decoder receives SIGCONT during waitNotify(), the kernel restarts the read() system call. This lets the decoder process block indefinitely, while the player process waits for it to react. This should probably be solved with a proper signal handler which aborts the read() system call, but for now, we just write to the pipe to make it wake up. git-svn-id: https://svn.musicpd.org/mpd/trunk@7216 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/decode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/decode.c b/src/decode.c index 3681e8025..180212d49 100644 --- a/src/decode.c +++ b/src/decode.c @@ -65,6 +65,7 @@ static void stopDecode(DecoderControl * dc) if (decode_pid > 0 && (dc->start || dc->state != DECODE_STATE_STOP)) { dc->stop = 1; kill(decode_pid, SIGCONT); + signalNotify(&(getPlayerData()->buffer.notify)); while (decode_pid > 0 && dc->stop) my_usleep(10000); } @@ -202,6 +203,7 @@ static int decodeSeek(PlayerControl * pc, DecoderControl * dc, dc->seekError = 0; dc->seek = 1; kill(decode_pid, SIGCONT); + signalNotify(&(getPlayerData()->buffer.notify)); while (decode_pid > 0 && dc->seek) my_usleep(10000); if (!dc->seekError) { -- cgit v1.2.3