[MPlayer-dev-eng] [PATCH] Report the reason to exit for -identify

rvm rvm3000 at ya.com
Mon Nov 10 23:50:53 CET 2008


El Lunes, 10 de Noviembre de 2008 01:29, Andrew Savchenko escribió:
> Hi,
>
> On Monday 10 November 2008 03:08, rvm wrote:
> > El Lunes, 3 de Noviembre de 2008 00:35, rvm escribió:
> > > Frontends may need to know the reason for what mplayer has
> > > exited (quitted by the user, end of file...). It already
> > > prints that info with these messages:
> > >
> > > Exiting... (Quit)
> > > Exiting... (End of file)
> > >
> > > The problem is that those strings are translatable strings. So
> > > if mplayer is compiled with another language as default, it
> > > will print other strings, making things harder for frontends.
> > >
> > > To fix the problem I suggest that mplayer would also print
> > > some strings for -identify, for example:
> > >
> > > ID_EXIT=QUIT
> > > ID_EXIT=EOF
> > > ID_EXIT=ERROR
> > >
> > > I attach a patch which does that. Although probably it's not
> > > implemented in the right way...
> >
> > No comments?
>
> It looks OK, but I'm not feeling myself brave enough to apply...
>
> P.S. Well, maybe it is better to use switch() block instead of lot
> of 'if' statements?

I think I can't use a switch. "how", "MSGTR_Exit_quit" and so on are pointers 
(const char *), not integers. Compiling fails if I try to use switch with 
them. Maybe I should have used strcmp instead so this would be clearer. I send 
a version of the patch with it.

Maybe the best would be to change the type of "how" from const char * to an 
int or enum, and then print one thing or another (in a switch) instead of 
having to compare the strings, but that would require some deeper changes.

-- 
rvm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: id_exit2.diff
Type: text/x-diff
Size: 814 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20081110/bb65738c/attachment.diff>


More information about the MPlayer-dev-eng mailing list