Fixed bug #357
authorSam Lantinga <slouken@libsdl.org>
Sun, 11 Oct 2009 08:40:35 +0000
changeset 44750248d0ec654
parent 446 1b8e02c89ed8
child 448 9310e2d423f7
Fixed bug #357

This was a sneaky one.
When music loops, the looping music play call is done from the audio thread, and SDL threads block signals to avoid signal side effects. So we just need to unblock those signals before executing the new process.
music_cmd.c
     1.1 --- a/music_cmd.c	Sun Oct 11 07:25:58 2009 +0000
     1.2 +++ b/music_cmd.c	Sun Oct 11 08:40:35 2009 +0000
     1.3 @@ -155,6 +155,13 @@
     1.4  		    char command[PATH_MAX];
     1.5  		    char **argv;
     1.6  
     1.7 +		    /* Unblock signals in case we're called from a thread */
     1.8 +		    {
     1.9 +			sigset_t mask;
    1.10 +			sigemptyset(&mask);
    1.11 +			sigprocmask(SIG_SETMASK, &mask, NULL);
    1.12 +		    }
    1.13 +
    1.14  		    /* Execute the command */
    1.15  		    strcpy(command, music->cmd);
    1.16  		    argv = parse_args(command, music->file);