in reply to The system command and waiting for the child process to finish
Most likely it's mplayer itself that doesn't wait. If you take a small test program like
perl -e 'sleep 5; echo $$' [download]
then likely the whole setup works.