Alexander Strasser | 12 May 2012 21:34
Picon

[PATCH 0/2] configure fixes

Hi!

  While testing on Cygwin I stumbled over 2 problems
this patch series tries to solve.

  These patches apply to both the code base from the 1.1
release preview and current SVN.

  For the first patch I do not know if it is the best
solution, but it was the first Idea that came to mind
and it worked fine. I tested vo directx with and without
hwaccel and the module worked fine here AFAICT.

  Please let me know what you think about it.

Alexander Strasser (2):
  build: Fix vo directx compilation on Cygwin
  build: Update SDL test to check for new features

 configure |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

--

-- 
1.7.5.4
Alexander Strasser | 12 May 2012 21:35
Picon

[PATCH 1/2] build: Fix vo directx compilation on Cygwin

  Without windows.h included syntax errors will
arise inside the ddraw.h header.
---
 configure |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 1afb4c1..13e1683 100755
--- a/configure
+++ b/configure
 <at>  <at>  -5252,6 +5252,7  <at>  <at>  echores "$_direct3d"
 echocheck "Directx"
 if test "$_directx" = auto ; then
   cat > $TMPC << EOF
+#include <windows.h>
 #include <ddraw.h>
 #include <dsound.h>
 int main(void) { return 0; }
--

-- 
1.7.5.4
Reimar Döffinger | 13 May 2012 14:48
Picon
Picon

Re: [PATCH 1/2] build: Fix vo directx compilation on Cygwin

The "recommended", wine-based ddraw.h header I believe does not have that problem, but the change is fine
by me.

On 12 May 2012, at 21:35, Alexander Strasser <eclipse7 <at> gmx.net> wrote:

>  Without windows.h included syntax errors will
> arise inside the ddraw.h header.
> ---
> configure |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/configure b/configure
> index 1afb4c1..13e1683 100755
> --- a/configure
> +++ b/configure
>  <at>  <at>  -5252,6 +5252,7  <at>  <at>  echores "$_direct3d"
> echocheck "Directx"
> if test "$_directx" = auto ; then
>   cat > $TMPC << EOF
> +#include <windows.h>
> #include <ddraw.h>
> #include <dsound.h>
> int main(void) { return 0; }
> -- 
> 1.7.5.4
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng <at> mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
(Continue reading)

Alexander Strasser | 13 May 2012 16:54
Picon

Re: [PATCH 1/2] build: Fix vo directx compilation on Cygwin

Hi Reimar,

Reimar Döffinger wrote:
> The "recommended", wine-based ddraw.h header I believe does not have that problem, but the change is fine
by me.

  Oh, I didn't know about that. But at least if they didn't change in
the last years, it does not work with the headers on MPHQ website which
are linked from the Windows documentation chapter.

  So I will wait a bit if someone else wants to speak up. If I hear no
objections I will apply it to make life easier for those not using the
wine-based headers.

> On 12 May 2012, at 21:35, Alexander Strasser <eclipse7 <at> gmx.net> wrote:
[patch snipped]

  Alexander
Ingo Brückl | 13 May 2012 22:29
Picon

Re: [PATCH 1/2] build: Fix vo directx compilation on Cygwin

Alexander Strasser wrote on Sun, 13 May 2012 16:54:00 +0200:

> Reimar Döffinger wrote:
>> The "recommended", wine-based ddraw.h header I believe does not have that
>> problem, but the change is fine by me.

Yes, that's right.

>   Oh, I didn't know about that. But at least if they didn't change in
> the last years, it does not work with the headers on MPHQ website which
> are linked from the Windows documentation chapter.

>   So I will wait a bit if someone else wants to speak up. If I hear no
> objections I will apply it to make life easier for those not using the
> wine-based headers.

The patch, although not necessary, harms neither the Wine port nor the
legacy-Cygwin port nor the MinGW port (all using different ddraw.h headers,
at least on my system), so no objection.

Ingo
Alexander Strasser | 12 May 2012 21:36
Picon

[PATCH 2/2] build: Update SDL test to check for new features

  Since we are using SDL_VideoInfo() now to get current_w
and current_h, we must check for their existence in our
configure script to avoid build failures on systems with an
outdated SDL.
---
 configure |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 13e1683..a519de0 100755
--- a/configure
+++ b/configure
 <at>  <at>  -5026,7 +5026,14  <at>  <at>  if test "$_sdl" = auto || test "$_sdl" = yes ; then
 #undef main
 #endif
 int main(int argc, char *argv[]) {
+  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;
+
   return 0;
 }
 EOF
--

-- 
1.7.5.4
(Continue reading)

Reimar Döffinger | 13 May 2012 14:50
Picon
Picon

Re: [PATCH 2/2] build: Update SDL test to check for new features

On 12 May 2012, at 21:36, Alexander Strasser <eclipse7 <at> gmx.net> wrote:
>  Since we are using SDL_VideoInfo() now to get current_w
> and current_h, we must check for their existence in our
> configure script to avoid build failures on systems with an
> outdated SDL.
> ---
> configure |    7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/configure b/configure
> index 13e1683..a519de0 100755
> --- a/configure
> +++ b/configure
>  <at>  <at>  -5026,7 +5026,14  <at>  <at>  if test "$_sdl" = auto || test "$_sdl" = yes ; then
> #undef main
> #endif
> int main(int argc, char *argv[]) {
> +  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?
Alternatively that call could be put under an SDL_VERSION ifdef or such...
(Continue reading)

Alexander Strasser | 13 May 2012 17:14
Picon

Re: [PATCH 2/2] build: Update SDL test to check for new features

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...
(Continue reading)

Alexander Strasser | 22 May 2012 00:43
Picon

Re: [PATCH 0/2] configure fixes

Alexander Strasser wrote:
>   While testing on Cygwin I stumbled over 2 problems
> this patch series tries to solve.
> 
>   These patches apply to both the code base from the 1.1
> release preview and current SVN.
> 
>   For the first patch I do not know if it is the best
> solution, but it was the first Idea that came to mind
> and it worked fine. I tested vo directx with and without
> hwaccel and the module worked fine here AFAICT.
> 
>   Please let me know what you think about it.
> 
> Alexander Strasser (2):
>   build: Fix vo directx compilation on Cygwin

  Applied this one as there were no objections and it
makes things easier for people (including me).

>   build: Update SDL test to check for new features

  This one is dropped.
  Thanks for the alternative fix go to Reimar!

  Alexander

Gmane