diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-05 12:46:05 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-05 12:46:05 +1300 |
commit | 57b722612775514ca6e3e4b67d8f547c6c0b47da (patch) | |
tree | 0540919ca6002cb5d601567af1666a644abf77be | |
parent | Fix up the test LRC a bit (diff) | |
download | mpdlrc-57b722612775514ca6e3e4b67d8f547c6c0b47da.tar.gz mpdlrc-57b722612775514ca6e3e4b67d8f547c6c0b47da.zip |
Move child kill to the end of the loop
-rwxr-xr-x | mpdlrc | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -44,11 +44,6 @@ binmode *STDOUT, ':encoding(utf8)'; MPD: while (1) { - # Something important happened; kill any running lyric processes - if ($pid) { - kill 'INT', $pid; - } - # Get the current status my $status = $mpd->update_status(); @@ -91,6 +86,11 @@ MPD: while (1) { # Wait for something else to happen to the player, whether or not there's a # forked process going $mpd->idle('player'); + + # Something important happened; kill any running lyric processes + if ($pid) { + kill 'INT', $pid; + } } # Subroutine to read lyrics from the given filename and return a queue object |