[MPlayer-dev-eng] [PATCH] mpdvdkit2 cygwin support

Joey Parrish joey at yunamusic.com
Thu Aug 15 06:32:54 CEST 2002


On Wed, Aug 14, 2002 at 09:34:38PM -0500, Joey Parrish wrote:
> I wish I still had saved a copy of the errors that mplayer was
> returning without this patch.  I'm away from home for a few days
> right now.  If I can call home and get one of my roomates to
> help me out, maybe I can get a remote shell on my cygwin testing
> machine and get back to you with the details of this whole thing.
Well, that didn't take very long after all.  :)

Here's the errors from mplayer without this patch:

Playing DVD title 1
libdvdread: Couldn't find device name.
Reading disc structure, please wait...
libdvdread: Can't open file VIDEO_TS.IFO.
Can't open VMG info!

> On Thu, Aug 15, 2002 at 12:06:50AM +0200, Arpi wrote:
> > hmm. are you sure this patch is ok and working???

> > it would work only if cygwin handles DVD device as a directory(!) (S_ISDIR()
> > true) but it's really a raw device and can be open()'ed and read()'ed as
> > raw sectors? otherwise teh fallback method (DVDOpenPath()) would be OK.

> > A'rpi / Astral & ESP-team

Here's what I did for debugging:

@@ -261,6 +263,7 @@
     have_css = DVDInputSetup();
     if(dvd_key_dir){ free(dvd_key_dir); dvd_key_dir=NULL; }

+    printf("ISBLK: %d ISCHR: %d ISREG: %d ISDIR: %d\n",
+       S_ISBLK( fileinfo.st_mode ),
+       S_ISCHR( fileinfo.st_mode ),
+       S_ISREG( fileinfo.st_mode ),
+       S_ISDIR( fileinfo.st_mode ));
+
     /* First check if this is a block/char device or a file*/
     if( S_ISBLK( fileinfo.st_mode ) ||
        S_ISCHR( fileinfo.st_mode ) ||


And got this:

Playing DVD title 1
ISBLK: 0 ISCHR: 0 ISREG: 0 ISDIR: 1
Reading disc structure, please wait...

So the device (which on cygwin defaults to D:) is detected as a
directory by stat, even though it can be read as a raw device
under win32.  (It's windows.  It sucks, I know, but stay with
me. :D )  If this is translated into a mountpoint, it becomes
/cygdrive/d/, which is what gets stored in path_copy.  I think
personally that d: is more "proper" for win32 than /cygdrive/d/
because cygdrive is cygwin specific, whereas d: can be valid
even on mingw.  So that perhaps in the future mplayer could
be compiled on mingw without the dependance on the cygwin.dll,
I chose to use path instead of path_copy in these lines:
        dev_name = strdup(path);
        auth_drive = DVDOpenImageFile( path, have_css );
If you think that it should be the cygwin mountpoint, then
feel free to change path to path_copy here.

Since the device name is simply whatever was specified as
-dvd-device, I strdup path into dev_name.

If this patch is not applied, then it will default to
DVDOpenPath(), which does not work.  I haven't spent
the time to figure out why, but I didn't think it would
matter so long as DVDOpenImageFile works. (and it does.)
Should I start trying to debug DVDOpenPath's method on
cygwin?  Is there anything else that I left unclear
about the cygwin dvd support?

Glad to help,
--Joey

-- 

"All you need is love." --Darth Vader



More information about the MPlayer-dev-eng mailing list