diff options
author | phintuka <phintuka> | 2009-10-23 21:22:35 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2009-10-23 21:22:35 +0000 |
commit | 402d850937fade66c15240f31733916e4601227c (patch) | |
tree | 3de468b5e6836dbb364baad20276a47f7442ef54 | |
parent | 2ee3800c49dfe321ebaf0554e5c533f94a40d637 (diff) | |
download | xineliboutput-402d850937fade66c15240f31733916e4601227c.tar.gz xineliboutput-402d850937fade66c15240f31733916e4601227c.tar.bz2 |
Fixed handling ~ (home directory) in keyfile path
-rw-r--r-- | xine/BluRay/input_bluray.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c index 54b20f3b..d5c09b15 100644 --- a/xine/BluRay/input_bluray.c +++ b/xine/BluRay/input_bluray.c @@ -264,11 +264,19 @@ static int bluray_plugin_open (input_plugin_t *this_gen) /* open libbluray */ - if (! (this->bdh = bd_open (disc_root, this->class->keyfile))) { + /* replace ~/ in keyfile path */ + char *keyfile = NULL; + if (this->class->keyfile && !strncmp(this->class->keyfile, "~/", 2)) + if (asprintf(&keyfile, "%s/%s", xine_get_homedir(), this->class->keyfile + 2) < 0) + keyfile = NULL; + /* open */ + if (! (this->bdh = bd_open (disc_root, keyfile ?: this->class->keyfile))) { LOGMSG("bd_open(\'%s\') failed: %s\n", disc_root, strerror(errno)); + free(keyfile); free(disc_root); return -1; } + free(keyfile); TRACE("bd_open(\'%s\') OK\n", disc_root); /* select title */ |