[vlc-commits] commit: udev: fix disc device node encoding ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Mon Aug 9 18:22:36 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug  9 19:20:04 2010 +0300| [653b7892d5f1d09caf9eeb4ed040012ced7af5cb] | committer: Rémi Denis-Courmont 

udev: fix disc device node encoding

Contrary to V4L2, the CDDA, DVD and BD plugins use the decoded file
path. In practice, this was a very minor problem as device node paths
normally only contain lower case ASCII, digits and the forward slash.

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

 modules/services_discovery/udev.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/services_discovery/udev.c b/modules/services_discovery/udev.c
index 95b6b1a..b7b7c7f 100644
--- a/modules/services_discovery/udev.c
+++ b/modules/services_discovery/udev.c
@@ -28,6 +28,7 @@
 #include <vlc_common.h>
 #include <vlc_services_discovery.h>
 #include <vlc_plugin.h>
+#include <vlc_url.h>
 #include <search.h>
 #include <poll.h>
 #include <errno.h>
@@ -562,11 +563,7 @@ static char *disc_get_mrl (struct udev_device *dev)
         return NULL;
 
     val = udev_device_get_devnode (dev);
-    char *mrl;
-
-    if (asprintf (&mrl, "%s://%s", scheme, val) == -1)
-        mrl = NULL;
-    return mrl;
+    return make_URI (val, scheme);
 }
 
 static char *disc_get_name (struct udev_device *dev)



More information about the vlc-commits mailing list