[MPlayer-cygwin] Cygwin port won't play on other PC

Joey Parrish joey at nicewarrior.org
Thu Jul 29 04:40:06 CEST 2004


On Wed, Jul 28, 2004 at 02:54:02PM +0200, Stefan Gürtler wrote:
> > And for my packages, if you use the file associations (recommended) then
> > you may right-click the file and select "open and log" to write a
> > verbose log file to $installdir/log.txt.  If you need this function from
> > commandline, run "mplayer -dumplog -v" ...
> > This is an option/feature I added into my packages.
> 
> Is there a possibility to get the -dumplog option into normal mingw builds.
> It can be very helpfull when there are problems while dropping clips on
> mplayer.exe.

Shouldn't be hard.  Feel free to adapt my patch any way you like.
The essence of it is this:

FILE *logfile = NULL;

void log_init(char *filename)
{
  if (logfile) fclose(logfile);
  logfile = fopen(filename, "w");
  *stdout = *logfile;
  *stderr = *logfile;
}

void log_uninit()
{
  if (!logfile) return;
  fclose(logfile);
  logfile = NULL;
}

The only real problem with this is that MPlayer begins printing messages
to the console before the option parsing happens.  In particular, the
version number is important for bug reports.  So my (cheap, hackish)
solution was to do a quick scan of the command line arguments and look
for -dumplog before MPlayer does any of it's parsing.  Then, I have a
dummy entry in mplayer's config stuff so that it doesn't die on an
unrecognized option.

I believe that MPlayer prints version info before option parsing for a
good reason.  It's probably in case the option parsing layer crashes the
app.  Then, you still have version info on the console to send in a
report of the option parsing crash.

If you come up with a better solution for this (other than moving the
parsing call or adding a hack like mine to look for -dumplog) then I
expect this option/feature could be committed into CVS.  But I can't
think of any good way to do it, and I'm not terribly concerned with
getting this committed.

--Joey

-- 
"Living in the complex world of the future is somewhat
like having bees live in your head.  But, there they are."




More information about the MPlayer-cygwin mailing list