[totem-pl-parser] videosite: Fix alternative resolution scripts
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] videosite: Fix alternative resolution scripts
- Date: Wed, 28 Oct 2015 14:33:16 +0000 (UTC)
commit 1be3144e9a6bf183a61c9596165d52bbe405b5cc
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 28 15:31:22 2015 +0100
videosite: Fix alternative resolution scripts
1147853ac9012c085ebb1d6306451c6d197542cf always returned the script's
filename instead of its fullpath, so never worked.
plparse/totem-pl-parser-videosite.c | 18 +++++++++++-------
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]