[MPlayer-cvslog] r32478 - in trunk: DOCS/tech/slave.txt command.c input/input.c input/input.h

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Oct 10 13:23:19 CEST 2010


On Sun, Oct 10, 2010 at 12:56:18PM +0200, Reimar Döffinger wrote:
> On Sun, Oct 10, 2010 at 11:30:42AM +0200, cigaes wrote:
> > Author: cigaes
> > Date: Sun Oct 10 11:30:42 2010
> > New Revision: 32478
> > 
> > Log:
> > Add the overlay_add and overlay_remove commands.
> 
> Uh, this was never reviewed.
> 
> > +static void overlay_add(char *file, int id, int x, int y, unsigned col)
> > +{
> > +    FILE *f;
> > +    unsigned w, h, nc;
> > +    unsigned char *data;
> > +    struct mp_eosd_image *img;
> > +
> > +    if (!(f = fopen(file, "r"))) {
> 
> I considert
> FILE *f = fopen(file, "r");
> if (!f)
> ...
> a lot more readable.
> This is in addition to the fact that it at least
> partially duplicates code in gl_common.c and is
> also wrong due to missing "b" in fopen and does
> not support comments (and some applications generate
> pnm files with comments by default).

I extracted the code in gl_common into a separate function,
it just needs to go into some appropriate file.
Note that I just found out that that "some application" is
e.g. GIMP. Your code will not be able to open any file created
with GIMP.


More information about the MPlayer-cvslog mailing list