Commit d2fbc302 authored by Sam Lade's avatar Sam Lade Committed by Jean-Baptiste Kempf

Bluray: fix playback when device is a symlink

(cherry picked from commit 21e4928a)
(cherry picked from commit 3e7cc6f5)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2c5cab2a
......@@ -183,13 +183,17 @@ 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 == NULL ? bd_path : bd_device))) {
strncpy (bd_path, m->mnt_dir, sizeof(bd_path));
bd_path[sizeof(bd_path) - 1] = '\0';
break;
}
}
free(bd_device);
endmntent (mtab);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment