[Mplayer-cvslog] CVS: main/libmpdemux cdda.c,1.11,1.12 stream_vcd.c,1.2,1.3

Alban Bedel CVS albeu at mplayerhq.hu
Wed Aug 13 13:18:49 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv14350/libmpdemux

Modified Files:
	cdda.c stream_vcd.c 
Log Message:
Fix -cdrom-device to work again with cdda and vcd.
Based on patch from Arwed von Merkatz.


Index: cdda.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cdda.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- cdda.c	17 May 2003 12:24:01 -0000	1.11
+++ cdda.c	13 Aug 2003 11:18:24 -0000	1.12
@@ -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,
+  NULL,
   { 0, 0 }
 };
 
@@ -99,6 +101,13 @@
   if(m != STREAM_READ) {
     m_struct_free(&stream_opts,opts);
     return STREAM_UNSUPORTED;
+  }
+
+  if(!p->device) {
+    if (cdrom_device)
+      p->device = strdup(cdrom_device);
+    else
+      p->device = strdup(DEFAULT_CDROM_DEVICE);
   }
 
 #ifdef MPLAYER_NETWORK

Index: stream_vcd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream_vcd.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- stream_vcd.c	17 May 2003 12:24:01 -0000	1.2
+++ stream_vcd.c	13 Aug 2003 11:18:24 -0000	1.3
@@ -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)
@@ -73,6 +75,13 @@
   if(mode != STREAM_READ) {
     m_struct_free(&stream_opts,opts);
     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);



More information about the MPlayer-cvslog mailing list