Mercurial > mplayer.hg
comparison libmpdemux/stream_vcd.c @ 10591:0d381b648b51
Fix -cdrom-device to work again with cdda and vcd.
Based on patch from Arwed von Merkatz.
author | albeu |
---|---|
date | Wed, 13 Aug 2003 11:18:24 +0000 |
parents | d42177a0da2a |
children | b2419eef04da |
comparison
equal
deleted
inserted
replaced
10590:73e7a5165bcd | 10591:0d381b648b51 |
---|---|
21 #include "vcd_read_nbsd.h" | 21 #include "vcd_read_nbsd.h" |
22 #else | 22 #else |
23 #include "vcd_read.h" | 23 #include "vcd_read.h" |
24 #endif | 24 #endif |
25 | 25 |
26 extern char *cdrom_device; | |
27 | |
26 static struct stream_priv_s { | 28 static struct stream_priv_s { |
27 int track; | 29 int track; |
28 char* device; | 30 char* device; |
29 } stream_priv_dflts = { | 31 } stream_priv_dflts = { |
30 1, | 32 1, |
31 DEFAULT_CDROM_DEVICE | 33 NULL |
32 }; | 34 }; |
33 | 35 |
34 #define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f) | 36 #define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f) |
35 /// URL definition | 37 /// URL definition |
36 static m_option_t stream_opts_fields[] = { | 38 static m_option_t stream_opts_fields[] = { |
71 #endif | 73 #endif |
72 | 74 |
73 if(mode != STREAM_READ) { | 75 if(mode != STREAM_READ) { |
74 m_struct_free(&stream_opts,opts); | 76 m_struct_free(&stream_opts,opts); |
75 return STREAM_UNSUPORTED; | 77 return STREAM_UNSUPORTED; |
78 } | |
79 | |
80 if (!p->device) { | |
81 if(cdrom_device) | |
82 p->device = strdup(cdrom_device); | |
83 else | |
84 p->device = strdup(DEFAULT_CDROM_DEVICE); | |
76 } | 85 } |
77 | 86 |
78 f=open(p->device,O_RDONLY); | 87 f=open(p->device,O_RDONLY); |
79 if(f<0){ | 88 if(f<0){ |
80 mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,p->device); | 89 mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,p->device); |