How do I run a terminal command without freezing the GUI app

I'm doing an app in wxWidgets and I need to run a linux command. The command is mpv <video URL> <some settings> and it runs the video from the link. It works but the problem is that the gui app freezes until I close the video window. I'm running the command by using "system(<command>);".
What should I do in order to avoid freezing the window when playing the video?
Last edited on
system() is synchronous. You could run it in the background, maybe system("mpv <args> &").

If you run it like that, I think you'll end up with a zombie process when mpv terminates. So you'll probably need to do the fork/exec/wait thing.
I added the "&" at the end and now it works! Big thanks :3
Topic archived. No new replies allowed.