summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2006-12-13 19:14:19 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2006-12-13 19:14:19 +0000
commit42b4630389962e4865ea1d45a01baa5a9eb86b12 (patch)
treec8afedb6ac36a5f5bb9b6833016cb36ae347b3ad /src
parent952847b799797174c03ad074f5651210f1c6ebb2 (diff)
downloadxine-lib-42b4630389962e4865ea1d45a01baa5a9eb86b12.tar.gz
xine-lib-42b4630389962e4865ea1d45a01baa5a9eb86b12.tar.bz2
Close the device if it was opened but the content isn't that of a VCD.
Holding it open prevents eject from working. CVS patchset: 8412 CVS date: 2006/12/13 19:14:19
Diffstat (limited to 'src')
-rw-r--r--src/input/vcd/vcdio.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/input/vcd/vcdio.c b/src/input/vcd/vcdio.c
index 7fee5a0db..31cc0cd49 100644
--- a/src/input/vcd/vcdio.c
+++ b/src/input/vcd/vcdio.c
@@ -1,5 +1,5 @@
/*
- $Id: vcdio.c,v 1.7 2005/06/14 17:27:12 rockyb Exp $
+ $Id: vcdio.c,v 1.8 2006/12/13 19:14:19 dsalt Exp $
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -103,9 +103,21 @@ vcdio_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device)
}
}
- 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;