[MPlayer-dev-eng] fix dynamic dvd drive selection on darwin

Emanuele Giaquinta e.giaquinta at glauco.it
Fri Nov 18 17:34:54 CET 2005


Hi,

The code in stream_dvd.c to detect the rdiskN device on darwin relies on
the return value of DVDOpen, which sometimes is not enough.  With a usb
drive mapped to rdisk1 and the dvd drive mapped to rdisk2, it chooses
rdisk1 cause DVDOpen does _not_ return 0 for it, ending with a
STREAM_UNSUPORTED later cause ifoOpen fails.  The attached patch fixes
it adding a test on ifoOpen.
-------------- next part --------------
Index: stream_dvd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream_dvd.c,v
retrieving revision 1.7
diff -u -r1.7 stream_dvd.c
--- stream_dvd.c	18 Nov 2005 14:39:20 -0000	1.7
+++ stream_dvd.c	18 Nov 2005 16:31:38 -0000
@@ -459,7 +459,7 @@
       for (i = 1; i < 10; i++) {
         sprintf(temp_device, "/dev/rdisk%d", i);
         dvd = DVDOpen(temp_device);
-        if(!dvd) {
+        if(!dvd || !(vmg_file = ifoOpen(dvd, 0))) {
           mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,temp_device);
         } else {
           free(temp_device);
@@ -488,7 +488,9 @@
      * Load the video manager to find out the information about the titles on
      * this disc.
      */
+#ifndef SYS_DARWIN
     vmg_file = ifoOpen(dvd, 0);
+#endif
     if(!vmg_file) {
       mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDnoVMG);
       DVDClose( dvd );


More information about the MPlayer-dev-eng mailing list