[MPlayer-dev-eng] [PATCH] honor cdrom-device setting

Arwed von Merkatz v.merkatz at gmx.net
Thu Jun 12 16:06:56 CEST 2003


Hi,

sorry for sending the earlier bugreport to this list instead of
mplayer-users.
Anyway, I just fixed the problem instead of sending the bugreport again
:)

With this patch, mplayer uses the -cdrom-device parameter and config
option again for vcd:// and cdda://

-- 
Arwed v. Merkatz
Grimoire Guru for video
Sourcemage GNU/Linux
http://www.sourcemage.org
-------------- next part --------------
Index: libmpdemux/cdda.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cdda.c,v
retrieving revision 1.11
diff -u -r1.11 cdda.c
--- libmpdemux/cdda.c	17 May 2003 12:24:01 -0000	1.11
+++ libmpdemux/cdda.c	12 Jun 2003 13:56:51 -0000
@@ -12,6 +12,8 @@
 
 #include "cdd.h"
 
+extern char *cdrom_device;
+
 static struct cdda_params {
   int speed;
   int paranoia_mode;
@@ -32,7 +34,7 @@
   0,
   0,
   0,
-  DEFAULT_CDROM_DEVICE,
+  "",
   { 0, 0 }
 };
 
@@ -99,6 +101,12 @@
   if(m != STREAM_READ) {
     m_struct_free(&stream_opts,opts);
     return STREAM_UNSUPORTED;
+  }
+
+  if ((strlen(p->device) == 0) && cdrom_device){
+    p->device = cdrom_device;
+  } else {
+    p->device = DEFAULT_CDROM_DEVICE;
   }
 
 #ifdef MPLAYER_NETWORK
Index: libmpdemux/stream_vcd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream_vcd.c,v
retrieving revision 1.2
diff -u -r1.2 stream_vcd.c
--- libmpdemux/stream_vcd.c	17 May 2003 12:24:01 -0000	1.2
+++ libmpdemux/stream_vcd.c	12 Jun 2003 13:56:52 -0000
@@ -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
+  ""
 };
 
 #define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f)
@@ -73,6 +75,12 @@
   if(mode != STREAM_READ) {
     m_struct_free(&stream_opts,opts);
     return STREAM_UNSUPORTED;
+  }
+
+  if ((strlen(p->device) == 0) && cdrom_device){
+    p->device = cdrom_device;
+  } else {
+    p->device = DEFAULT_CDROM_DEVICE;
   }
 
   f=open(p->device,O_RDONLY);


More information about the MPlayer-dev-eng mailing list