[vlc-commits] Bluray: fix playback when device is a symlink

Sam Lade git at videolan.org
Sun Jun 3 17:11:33 CEST 2012


vlc | branch: master | Sam Lade <sam at sentynel.com> | Sun Jun  3 16:57:00 2012 +0200| [21e4928a6b98fd7b6bb520b5f1b863738a695295] | committer: Jean-Baptiste Kempf

Bluray: fix playback when device is a symlink

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21e4928a6b98fd7b6bb520b5f1b863738a695295
---

 modules/access/bluray.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 3208279..254001f 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -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;



More information about the vlc-commits mailing list