summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_dvd.c32
-rw-r--r--src/input/media_helper.c19
2 files changed, 40 insertions, 11 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 8a207a644..492afcfaa 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.159 2003/05/03 14:24:08 mroi Exp $
+ * $Id: input_dvd.c,v 1.160 2003/05/06 14:02:25 tchamp Exp $
*
*/
@@ -83,14 +83,9 @@
/* DVDNAV includes */
#ifdef HAVE_DVDNAV
-#ifndef _MSC_VER
# include <dvdnav/dvdnav.h>
# include <dvdnav/nav_read.h>
#else
-# include "dvdnav.h"
-# include "nav_read.h"
-#endif /* _MSC_VER */
-#else
# define DVDNAV_COMPILE
# include "dvdnav.h"
#endif
@@ -121,6 +116,10 @@
#if defined(__sun)
#define DVD_PATH "/vol/dev/aliases/cdrom0"
#define RDVD_PATH ""
+#elif WIN32
+/* There really isn't a default on Windows! */
+#define DVD_PATH "d:\\"
+#define RDVD_PATH "d:\\"
#else
#define DVD_PATH "/dev/dvd"
#define RDVD_PATH "/dev/rdvd"
@@ -1228,12 +1227,17 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
/* we already checked the "dvd:/" MRL above */
locator = &this->mrl[strlen(handled_mrl)];
while (*locator == '/') locator++;
+
+#ifndef _MSC_VER
/* we skipped at least one slash, get it back */
locator--;
+#endif
/* Attempt to parse MRL */
last_slash = strlen(locator);
- while(last_slash && locator[last_slash] != '/') last_slash--;
+ while(last_slash &&
+ ((locator[last_slash] != '/') && (locator[last_slash] != '\\')))
+ last_slash--;
if(last_slash) {
/* we have an alternative dvd_path */
@@ -1243,7 +1247,13 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
}else{
intended_dvd_device=class->dvd_device;
}
+
+#ifdef _MSC_VER
+ if (*locator == '/')
+ locator++;
+#else
locator++;
+#endif
if(locator[0]) {
this->mode = MODE_TITLE;
@@ -1304,8 +1314,7 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
/* Set seek mode */
if (xine_config_lookup_entry(this->stream->xine, "input.dvd_seek_behaviour",
&cache_entry))
- seek_mode_cb(class, &cache_entry);
-
+ seek_mode_cb(class, &cache_entry);
if(this->mode == MODE_TITLE) {
int tt, i, pr, found;
@@ -1321,8 +1330,8 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
locator[i] = '\0';
}
}
- tt = strtol(locator, NULL,10);
+ tt = strtol(locator, NULL,10);
dvdnav_get_number_of_titles(this->dvdnav, &titles);
if((tt <= 0) || (tt > titles)) {
printf("input_dvd: Title %i is out of range (1 to %i).\n", tt,
@@ -1612,6 +1621,9 @@ static void *init_class (xine_t *xine, void *data) {
/*
* $Log: input_dvd.c,v $
+ * Revision 1.160 2003/05/06 14:02:25 tchamp
+ * This is some general Win32 cleanup and getting ready for DVD support.
+ *
* Revision 1.159 2003/05/03 14:24:08 mroi
* as announced on xine-devel:
* * I change the SPU decoder API to make it look less DVD specific
diff --git a/src/input/media_helper.c b/src/input/media_helper.c
index 8c71e09f7..5d387bb44 100644
--- a/src/input/media_helper.c
+++ b/src/input/media_helper.c
@@ -27,9 +27,13 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
+
+#ifndef WIN32
#include <sys/wait.h>
-#include <unistd.h>
#include <sys/ioctl.h>
+#endif
+
+#include <unistd.h>
#include <string.h>
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
@@ -38,6 +42,7 @@
#include <linux/cdrom.h>
#elif defined(HAVE_SYS_CDIO_H)
#include <sys/cdio.h>
+#elif WIN32
#else
#warning "This might not compile due to missing cdrom ioctls"
#endif
@@ -47,6 +52,7 @@
static int media_umount_media(char *device)
{
+#ifndef WIN32
char *argv[10];
int i;
pid_t pid;
@@ -71,11 +77,17 @@ static int media_umount_media(char *device)
} while(1);
return -1;
+#else
+ return 0;
+#endif /* WIN32 */
}
int media_eject_media (char *device) {
+
+#ifndef WIN32
int ret, status;
int fd;
+#endif /* WIN32 */
/* printf("input_dvd: Eject Device %s current device %s opened=%d handle=%p trying...\n",device, this->current_dvd_device, this->opened, this->dvdnav); */
media_umount_media(device);
@@ -83,6 +95,8 @@ int media_eject_media (char *device) {
printf("ipnut_dvd: umount result: %s\n",
strerror(errno));
***********/
+
+#ifndef WIN32
if ((fd = open (device, O_RDONLY|O_NONBLOCK)) > -1) {
#if defined (__linux__)
@@ -130,5 +144,8 @@ int media_eject_media (char *device) {
printf("input_dvd: Device %s failed to open during eject calls\n",device);
}
return 1;
+#else
+ return 0;
+#endif /* WIN32 */
}