[MPlayer-cygwin] [patch] add adapter selection to vo_directx(onlyvm)

Rune runner at mail.tele.dk
Mon Jan 26 21:39:32 CET 2004


----- Original Message -----
From: "Joey Parrish" <joey at nicewarrior.org>
To: "Win32/CygWin porting" <mplayer-cygwin at mplayerhq.hu>
Sent: Monday, January 26, 2004 9:07 PM
Subject: Re: [MPlayer-cygwin] [patch] add adapter selection to
vo_directx(onlyvm)


>
> This doesn't have to do with your patch, exactly, but I was just
> reminded of this segment of code.  Sorry if it's too off-topic.
>
> - //load direct draw DLL: based on videolans code
> + //load direct draw DLL: based on videolans code... not much left
>   hddraw_dll = LoadLibrary("DDRAW.DLL");
>
> For this part, is there any good reason why we don't link against the
> library instead of loading it?  If we compile in the directx vo, then
> we want/have directx support.  So whoever compiles this doesn't need to
> dynamically load ddraw.
>
> If we have a situation of shipping binaries, then maybe a user might not
> have the dll.  If we link against it, then the application won't start
> without it.  But if we are shipping a directx binary, there probably
> aren't any other vo's to use in the first place, so no loss.
>
> The only thing I can think of is that if a user doesn't have the right
> dll, then LoadLibrary gives us a chance to say "Hey, you don't have
> DirectX" in a friendly way.  But for the sake of windows kids, we aren't
> doing that in the first place.  If you need to be told to install
> DirectX, then a text message on the console buried in a hundred other
> lines won't help.

Im new to DirectX but I see it like this: (don't kill me if im wrong)
The library will also link against ddraw.dll we don't need to link to it.
We need the ddraw.dll handle to make sure that the function
"DirectDrawEnumerateEx" exists.
if not "You need DirectX 7 or higher..."

Of couse we could just skip most error messages on the basis that most
people
will never see them, but I would die trying to debug it with no error
messages.

We could do the DirectX 7 check earlier so the error would be the only
(almost)
message you'd see, but then the code would be moved to something like
mplayer.c

Rune




More information about the MPlayer-cygwin mailing list