]> git.sesse.net Git - vlc/commitdiff
udev: fix disc device node encoding
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 9 Aug 2010 16:20:04 +0000 (19:20 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 9 Aug 2010 16:22:32 +0000 (19:22 +0300)
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.

modules/services_discovery/udev.c

index 95b6b1a8288cce931af8cdb04218600bbcea9d2d..b7b7c7f078f4985756e1db982443a911edbd5906 100644 (file)
@@ -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)