]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/udev.c
udev: fix disc device node encoding
[vlc] / 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)