]> git.sesse.net Git - vlc/commitdiff
Bluray: fix playback when device is a symlink
authorSam Lade <sam@sentynel.com>
Sun, 3 Jun 2012 14:57:00 +0000 (16:57 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 3 Jun 2012 14:57:53 +0000 (16:57 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/access/bluray.c

index 32082799f8f4f2891402524b8475b3ba9d98b47e..254001fc513d3782f6cd5d7fda06deda67b4be31 100644 (file)
@@ -194,8 +194,11 @@ static int blurayOpen( vlc_object_t *object )
             struct mntent* m;
             struct mntent mbuf;
             char buf [8192];
+            /* bd_path may be a symlink (e.g. /dev/dvd -> /dev/sr0), so make
+             * sure we look up the real device */
+            char* bd_device = realpath(bd_path, NULL);
             while ((m = getmntent_r (mtab, &mbuf, buf, sizeof(buf))) != NULL) {
-                if (!strcmp (m->mnt_fsname, bd_path)) {
+                if (!strcmp (m->mnt_fsname, bd_device)) {
                     strncpy (bd_path, m->mnt_dir, sizeof(bd_path));
                     bd_path[sizeof(bd_path) - 1] = '\0';
                     break;