From e5e805b73ff0bdf92799e6ae371d6e2005b4df46 Mon Sep 17 00:00:00 2001 From: albeu Date: Wed, 13 Aug 2003 11:18:24 +0000 Subject: Fix -cdrom-device to work again with cdda and vcd. Based on patch from Arwed von Merkatz. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10592 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/cdda.c | 11 ++++++++++- libmpdemux/stream_vcd.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'libmpdemux') diff --git a/libmpdemux/cdda.c b/libmpdemux/cdda.c index d33e5a5dba..6d46e1aab3 100644 --- a/libmpdemux/cdda.c +++ b/libmpdemux/cdda.c @@ -12,6 +12,8 @@ #include "cdd.h" +extern char *cdrom_device; + static struct cdda_params { int speed; int paranoia_mode; @@ -32,7 +34,7 @@ static struct cdda_params { 0, 0, 0, - DEFAULT_CDROM_DEVICE, + NULL, { 0, 0 } }; @@ -101,6 +103,13 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) { return STREAM_UNSUPORTED; } + if(!p->device) { + if (cdrom_device) + p->device = strdup(cdrom_device); + else + p->device = strdup(DEFAULT_CDROM_DEVICE); + } + #ifdef MPLAYER_NETWORK if(strncmp(st->url,"cddb",4) == 0) { i = cddb_resolve(p->device, &xmcd_file); diff --git a/libmpdemux/stream_vcd.c b/libmpdemux/stream_vcd.c index 1904b4bc56..7f4bace00a 100644 --- a/libmpdemux/stream_vcd.c +++ b/libmpdemux/stream_vcd.c @@ -23,12 +23,14 @@ #include "vcd_read.h" #endif +extern char *cdrom_device; + static struct stream_priv_s { int track; char* device; } stream_priv_dflts = { 1, - DEFAULT_CDROM_DEVICE + NULL }; #define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f) @@ -75,6 +77,13 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { return STREAM_UNSUPORTED; } + if (!p->device) { + if(cdrom_device) + p->device = strdup(cdrom_device); + else + p->device = strdup(DEFAULT_CDROM_DEVICE); + } + f=open(p->device,O_RDONLY); if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,p->device); -- cgit v1.2.3