[MPlayer-users] MPlayer won't STFU / MPlayer doesn't report errors

rcooley rcooley at spamcop.net
Mon Jul 19 09:07:44 CEST 2004


I'm trying to script mplayer, but have had the same problems for a long
time...  It just won't STFU.  Even with -really-quiet, it still outputs
the following on stdout:

MPlayer dev-CVS-040707-07:29-3.2.2 (C) 2000-2004 MPlayer Team

CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 1600 MHz (Family:
6, Stepping: 1) Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Reading config file /etc/mplayer/mplayer.conf
Reading config file /home/root/.mplayer/config
Reading /home/root/.mplayer/codecs.conf: Reading
/etc/mplayer/codecs.conf: Using built-in default codecs.conf. font:
can't open file: /home/root/.mplayer/font/font.desc font: can't open
file: /usr/local/share/mplayer/font/font.desc 

Since it always output that no matter what, I can't use stdout for
pcm audio.  (eg. mplayer -really-quiet -vc dummy -ao pcm -aofile
/dev/stdout | oggenc - )

I can't use a fifo because, if mplayer quits for some reason (can't find
the file, invalid options, errors, etc), the program I'm piping audio
to, will continue trying to read from the fifo, and just hold up the
whole script.  Using stdout is the only way that mplayer can tell the
OTHER program that it should exit now...  If someone has another way of
doing it, I'd like to hear it.


Another problem with mplayer is that it doesn't report errors when
it can't open a file, like a normal unix programs.  So the operators
"&&" and"||" are completely useless with MPlayer.

Here's an example of how it should work:

  $ cat non-existant-file && echo SUCCESS || echo FAILURE
  FAILURE
  
  $ cat /dev/null && echo SUCCESS || echo FAILURE
  SUCCESS

MPlayer, however, always reports success, even when it can't find the
file.

  $ mplayer non-existant-file && echo SUCCESS || echo FAILURE
  Playing non-existant-file.
  File not found: 'non-existant-file'
  Failed to open non-existant-file
  
  Exiting... (End of file)
  SUCCESS

This makes scripting mplayer much more difficult than it needs to be.




More information about the MPlayer-users mailing list