[libdvdcss-devel] [PATCH] Fix OS/2 in MPlayers libdvdcss.c

Diego Biurrun diego at biurrun.de
Fri Jan 25 10:05:00 CET 2013


On Tue, Jan 22, 2013 at 08:00:27PM -0800, Dave Yeo wrote:
> MPlayer now unconditionally defines HAVE_DIRECT_H to 1 if a system has direct.h. This causes Windows code to be used breaking MPlayers OS/2 support
> 
> libdvdcss/libdvdcss.c: In function 'dvdcss_open':
> libdvdcss/libdvdcss.c:242: error: expected ')' before '*' token
> libdvdcss/libdvdcss.c:249: error: 'MAX_PATH' undeclared (first use
> in this function)
> libdvdcss/libdvdcss.c:249: error: (Each undeclared identifier is
> reported only once
> libdvdcss/libdvdcss.c:249: error: for each function it appears in.)
> libdvdcss/libdvdcss.c:250: error: 'HINSTANCE' undeclared (first use
> in this function)
> libdvdcss/libdvdcss.c:250: error: expected ';' before 'p_dll'
> ...
> [more errors]
> 
> Simple fix attached
> Dave

> --- src/libdvdcss.c	(revision 256)
> +++ src/libdvdcss.c	(working copy)
> @@ -238,7 +238,7 @@
>       */
>      if( psz_cache == NULL || psz_cache[0] == '\0' )
>      {
> -#ifdef HAVE_DIRECT_H
> +#ifdef WIN32
>          typedef HRESULT( WINAPI *SHGETFOLDERPATH )
>                         ( HWND, int, HANDLE, DWORD, LPTSTR );
>  

I believe this is correct, but I suspect the direct.h #include
could also be removed along with this change.  That would require
testing on Windows and/or MSVC and/or MinGW though.

Diego


More information about the libdvdcss-devel mailing list