[MPlayer-dev-eng] [PATCH] regression fix: make -cdrom-device work again
Arwed von Merkatz
v.merkatz at gmx.net
Tue Aug 12 14:57:34 CEST 2003
On Mon, Aug 11, 2003 at 02:48:47AM +0200, Diego Biurrun wrote:
> Alex Beregszaszi writes:
> > > What about this patch?
> > Once Arpi said it's ok to commit, test it and apply it.
>
> Errm, I lost it :-(
>
> Could you or whoever made it resend it?
>
> Diego
Here it is. (for the third time, don't lose it again please ;)
--
Arwed v. Merkatz
Grimoire Guru for video
Grimoire Guru for xfce
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 Aug 2003 13:08:18 -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 Aug 2003 13:08:19 -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