Update of /cvsroot/xine/xine-lib/src/input/vcd
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26598/src/input/vcd

Modified Files:
        vcdio.c 
Log Message:
Close the device if it was opened but the content isn't that of a VCD.
Holding it open prevents eject from working.

Index: vcdio.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/input/vcd/vcdio.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vcdio.c     14 Jun 2005 17:27:12 -0000      1.7
+++ vcdio.c     13 Dec 2006 19:14:19 -0000      1.8
@@ -103,9 +103,21 @@
     }
   }
 
-  if ( vcdinfo_open(&p_vcdplayer->vcd, &intended_vcd_device, DRIVER_UNKNOWN, 
-                    NULL) != VCDINFO_OPEN_VCD) {
-    return false;
+  switch ( vcdinfo_open(&p_vcdplayer->vcd, &intended_vcd_device,
+                        DRIVER_UNKNOWN, NULL))
+  {
+    case VCDINFO_OPEN_ERROR:
+      /* Failed to open the device => return failure */
+      return false;
+
+    case VCDINFO_OPEN_VCD:
+      /* Opened the device, and it's a VCD => proceed */
+      break;
+
+    default:
+      /* Opened the device, but it's not a VCD => close it & return failure */
+      vcdinfo_close(p_vcdplayer->vcd);
+      return false;
   }
 
   p_vcdinfo = p_vcdplayer->vcd;


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to