SDL_mixer
SDL_mixer copied to clipboard
MusicCMD_Play vs vfork
MusicCMD_Play might call vfork(), depending on how the build was configured. vfork requires the child process to do nothing except call either exec*() or _exit() immediately or disaster may occur.
https://www.man7.org/linux/man-pages/man2/vfork.2.html
However, after vfork'ing, we parse a string into an array, including calling SDL_malloc().
We either need to parse this (and free it) in the parent, so it's available in the child after the vfork, or we need to ust use regular fork() here.
The perror() call in the child probably needs to go, too. It's not clear if vfork children can legally call sigprocmask. I'm guessing not.
(also, wow, let's deprecate Mix_SetMusicCMD in general.)
(also, wow, let's deprecate Mix_SetMusicCMD in general.)
Oh yes - and right now is best yes?
Patch to remove support for music playback using an external cmd: patch.txt
The patch looks good, but please don't apply it in the 2.X series. Removal of a supported music method would be considered an ABI change.
Well, pity..