[MPlayer-users] How to properly terminate a looping mplayer

Deron Kazmaier deron at pagestream.org
Tue Oct 18 18:50:28 CEST 2011


Hi,

I wrote a fun little program that simple forks and runs mplayer, asking 
it to loop a video forever (-loop 0). I keep the pid, and when I detect 
a condition that requires the video to stop playing, I send mplayer a 
SIGTERM.

That is all fine and dandy and works just fine, except that there is 
about a 50:50 chance that the shell will be screwed up when the program 
that calls mplayer terminates and returns to the shell. Nothing I type 
will appear, but it does accept the input (this is via ssh) and pressing 
return will execute whatever I type and it will display the shell prompt 
but on the same line. I know, very odd.

So, the only thing I can think of is that SIGTERM mplayer caused some 
control code to be sent to stderr/stdout?

Before I simply pipe output/input to null, I want to make sure that I'm 
stopping mplayer in an acceptable way or should I be sending a different 
signal or passing something via input pipe.

Thanks! Still have a blast with mplayer!!

Deron



More information about the MPlayer-users mailing list