[MPlayer-dev-eng] [PATCH 2/2] build: Update SDL test to check for new features

Alexander Strasser eclipse7 at gmx.net
Sun May 13 17:14:49 CEST 2012


Hi,

Reimar Döffinger wrote:
> On 12 May 2012, at 21:36, Alexander Strasser <eclipse7 at gmx.net> wrote:
[...]
> > +  int tmp;
> > +  const SDL_VideoInfo *vi;
> > +
> >   SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
> > +  vi = SDL_GetVideoInfo();
> > +  tmp = vi->current_w;
> > +  tmp = vi->current_h;
> 
> Seems a bit like overkill to me.
> Any reason to believe that just adding a call to GetVideoInfo (without any of the extra variables) wouldn't be good enough?

  There was a time when SDL_VideoInfo structure didn't have those
members.

  Checking only for one of them should be fine though. Not using
the tmp variables would probably be good enough too, since the
compiler required to check if the member exists syntactically, even
if it isn't used in the end AFAIK.

  I guess I was a bit too paranoid while writing that code :)

> Alternatively that call could be put under an SDL_VERSION ifdef or such...

  Not sure if I like that...

  What do you think about me figuring out how to get the runtime version
and checking that version in configure and in the sdl_common module before
calling that function? Would probably make both places more correct and
make potential baseline SDL checks easier in the future.


Thanks for the review,
  Alexander


More information about the MPlayer-dev-eng mailing list