#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>
if (val && !strcmp (val, "blank"))
return NULL; /* ignore empty drives and virgin recordable discs */
- const char *scheme = "invalid";
+ const char *scheme = NULL;
val = udev_device_get_property_value (dev,
"ID_CDROM_MEDIA_TRACK_COUNT_AUDIO");
if (val && atoi (val))
scheme = "cdda"; /* Audio CD rather than file system */
val = udev_device_get_property_value (dev, "ID_CDROM_MEDIA_DVD");
if (val && atoi (val))
- scheme = "file";
+ scheme = "dvd";
val = udev_device_get_property_value (dev, "ID_CDROM_MEDIA_BD");
if (val && atoi (val))
/* We didn't get any property that could tell we have optical disc
that we can play */
- if( !strcmp( scheme, "invalid" ) )
+ if (scheme == NULL)
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)