[MPlayer-dev-eng] main: [BUG?] draw_slice in vd_libmpeg2.c and [PATCH] some warning fixes

D Richard Felker III dalias at aerifal.cx
Mon Jun 2 01:51:31 CEST 2003


On Sun, Jun 01, 2003 at 11:16:26PM +0200, Alex Beregszaszi wrote:
> Hi,
> 
> > draw_slice() is defined in libmpcodecs/vf.h:
> >     void (*draw_slice)(struct vf_instance_s* vf,
> >         unsigned char** src, int* stride, int w,int h, int x, int y);
> > 
> > convert() is defined in libmpeg2/mpeg2_internal.h
> >     void (* convert) (void * fbuf_id, uint8_t * const * src,
> >                       unsigned int v_offset);
> > 
> > As you see, these are quite different.
> But have a closer look there.. the draw_slice() is defined locally as
> the convert() function requires it, ok it differs, and basically it's
> just a hack...
> 
> static void draw_slice (void * _sh, uint8_t ** src, unsigned int y)
> 
> > And here's a patch that tries to fix some warnings:
> > 
> > vf.c:496: warning: passing arg 6 of `memcpy_pic' makes integer from
> > pointer without a cast-> I think it should be stride[0], not stride as
> > parameter, but I don't pretend to understand the code, so I might be
> > wrong.
> Yes it looks buggy, Arpi? Rich? Michael? or whoever wrote the slices RGB
> support.

Yes, it's wrong, and yes, I wrote it. I'll go drink my cola.

> > Also I think it's a good idea to remove duplicate definitions of
> > get_sws_cpuflags() from Gui/wm/ws.c and libmpcodecs/vf_scale.c and put
> > it in postproc/swscale.[ch] so that it can be automatically visible in
> > vf_sab.c and vf_smartblur.c where it's used (and gives "implicit
> > declaration" warnings now).
> The basic ide on that was that swscale/ should be as independt as it
> could be.
> I prupose making get_sws_cpuflags() global in vf_scale.c and the others
> should
> call it from there.

This will work for now, but imo it's a bad design for other parts of
the code to depend on filters, since in the long term they'll be
independent modules.

> > vo_dga.c:328: warning: implicit declaration of function `rgb15to16'
> > -> missing #include "../postproc/rgb2rgb.h"
> > 
> > vo_dga.c:687: warning: implicit declaration of function `SwScale_Init'
> > -> could as well be removed, because it doesn't do anything according
> I have a 'reworked' dga code in my local tree, which removes all that
> stuff.

Is it ready to commit?

Rich



More information about the MPlayer-dev-eng mailing list