[vlc-commits] cdda: take cd-audio option

Rémi Denis-Courmont git at videolan.org
Wed Apr 27 22:26:32 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 27 23:26:21 2016 +0300| [98dd4c30db57f88a92be16aa694f5d9fda08c15c] | committer: Rémi Denis-Courmont

cdda: take cd-audio option

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98dd4c30db57f88a92be16aa694f5d9fda08c15c
---

 modules/access/cdda.c |   21 +++++++++++++++++++++
 src/libvlc-module.c   |   13 ++++---------
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index a9eaae9..2c2d696 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -58,6 +58,24 @@
 static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
+#define CDAUDIO_DEV_TEXT N_("Audio CD device")
+#if defined( _WIN32 ) || defined( __OS2__ )
+# define CDAUDIO_DEV_LONGTEXT N_( \
+    "This is the default Audio CD drive (or file) to use. Don't forget the " \
+    "colon after the drive letter (e.g. D:)")
+# define CD_DEVICE      "D:"
+#else
+# define CDAUDIO_DEV_LONGTEXT N_( \
+    "This is the default Audio CD device to use." )
+# if defined(__OpenBSD__)
+#  define CD_DEVICE      "/dev/cd0c"
+# elif defined(__linux__)
+#  define CD_DEVICE      "/dev/sr0"
+# else
+#  define CD_DEVICE      "/dev/cdrom"
+# endif
+#endif
+
 vlc_module_begin ()
     set_shortname( N_("Audio CD") )
     set_description( N_("Audio CD input") )
@@ -66,6 +84,9 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_INPUT_ACCESS )
     set_callbacks( Open, Close )
 
+    add_loadfile( "cd-audio", CD_DEVICE, CDAUDIO_DEV_TEXT,
+                  CDAUDIO_DEV_LONGTEXT, false )
+
     add_usage_hint( N_("[cdda:][device][@[track]]") )
     add_integer( "cdda-track", 0 , NULL, NULL, true )
         change_volatile ()
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 5c6a6e0..d529c32 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -761,7 +761,7 @@ static const char *const ppsz_prefres[] = {
     "This is the default Audio CD drive (or file) to use. Don't forget the " \
     "colon after the drive letter (e.g. D:)")
 # define DVD_DEVICE     NULL
-# define CD_DEVICE      "D:"
+# define VCD_DEVICE     "D:"
 
 #else
 # define DVD_DEV_LONGTEXT N_( \
@@ -773,19 +773,16 @@ static const char *const ppsz_prefres[] = {
 
 # if defined(__OpenBSD__)
 #  define DVD_DEVICE     "/dev/cd0c"
-#  define CD_DEVICE      "/dev/cd0c"
+#  define VCD_DEVICE     "/dev/cd0c"
 # elif defined(__linux__)
 #  define DVD_DEVICE     "/dev/sr0"
-#  define CD_DEVICE      "/dev/sr0"
+#  define VCD_DEVICE     "/dev/sr0"
 # else
 #  define DVD_DEVICE     "/dev/dvd"
-#  define CD_DEVICE      "/dev/cdrom"
+#  define VCD_DEVICE     "/dev/cdrom"
 # endif
 #endif
 
-#define VCD_DEVICE       CD_DEVICE
-#define CDAUDIO_DEVICE   CD_DEVICE
-
 #define TIMEOUT_TEXT N_("TCP connection timeout")
 #define TIMEOUT_LONGTEXT N_( \
     "Default TCP connection timeout (in milliseconds)." )
@@ -1725,8 +1722,6 @@ vlc_module_begin ()
                   false )
     add_loadfile( "vcd", VCD_DEVICE, VCD_DEV_TEXT, VCD_DEV_LONGTEXT,
                   false )
-    add_loadfile( "cd-audio", CDAUDIO_DEVICE, CDAUDIO_DEV_TEXT,
-                  CDAUDIO_DEV_LONGTEXT, false )
 
     set_section( N_( "Network settings" ), NULL )
 



More information about the vlc-commits mailing list