summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2015-10-28 15:31:22 +0100
committerBastien Nocera <hadess@hadess.net>2015-10-28 15:31:22 +0100
commit1be3144e9a6bf183a61c9596165d52bbe405b5cc (patch)
tree4d180e32fb9ffae08f46d34b6b6accc66b1e3348
parentd2054d31f000cd131f05b749b210c3f9476dc9aa (diff)
downloadtotem-pl-parser-baserock/V_3_10_5-16-g1be3144.tar.gz
videosite: Fix alternative resolution scriptsbaserock/V_3_10_5-16-g1be3144
1147853ac9012c085ebb1d6306451c6d197542cf always returned the script's filename instead of its fullpath, so never worked.
-rw-r--r--plparse/totem-pl-parser-videosite.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index 6cb0837..f830a54 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -39,7 +39,7 @@ find_helper_script (void)
#else
GDir *dir;
const char *name;
- char *ret = NULL;
+ char *script_name = NULL;
dir = g_dir_open (LIBEXECDIR "/totem-pl-parser", 0, NULL);
if (!dir)
@@ -49,15 +49,19 @@ find_helper_script (void)
/* Skip hidden files */
if (name[0] == '.')
continue;
- if (ret == NULL || g_strcmp0 (name, ret) < 0) {
- g_free (ret);
- ret = g_strdup (name);
+ if (script_name == NULL || g_strcmp0 (name, script_name) < 0) {
+ g_free (script_name);
+ script_name = g_strdup (name);
}
}
g_clear_pointer (&dir, g_dir_close);
- if (ret != NULL)
+ if (script_name != NULL) {
+ char *ret;
+ ret = g_build_filename (LIBEXECDIR "/totem-pl-parser", script_name, NULL);
+ g_free (script_name);
return ret;
+ }
bail:
return g_strdup (LIBEXECDIR "/totem-pl-parser/99-totem-pl-parser-videosite");
@@ -93,8 +97,8 @@ totem_pl_parser_is_videosite (const char *uri, gboolean debug)
NULL,
NULL);
if (debug)
- g_print ("Checking videosite for URI '%s' returned '%s' (%s)\n",
- uri, out, g_strcmp0 (out, "TRUE") == 0 ? "true" : "false");
+ g_print ("Checking videosite with script '%s' for URI '%s' returned '%s' (%s)\n",
+ script, uri, out, g_strcmp0 (out, "TRUE") == 0 ? "true" : "false");
g_free (script);