summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-11-09 13:41:11 +0100
committerBastien Nocera <hadess@hadess.net>2019-11-09 14:16:54 +0100
commit869c81b98cd3d302b041e52ebeca080fd9afee09 (patch)
treec9da558615de1946a44ffc18775651f5d818c84a
parentc7c01211812acde1648891746050f23581008271 (diff)
downloadtotem-pl-parser-869c81b98cd3d302b041e52ebeca080fd9afee09.tar.gz
plparser: Further simplify totem_pl_parser_parse_internal()
This time the "do we try to use quvi" section, and fetch the URI outside this loop to make it available for another check.
-rw-r--r--plparse/totem-pl-parser.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index 6d11e29..bfc9a7f 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1771,6 +1771,7 @@ totem_pl_parser_parse_internal (TotemPlParser *parser,
{
g_autofree char *mimetype = NULL;
g_autofree gpointer data = NULL;
+ g_autofree char *uri = NULL;
guint i;
TotemPlParserResult ret = TOTEM_PL_PARSER_RESULT_UNHANDLED;
gboolean found = FALSE;
@@ -1809,18 +1810,15 @@ totem_pl_parser_parse_internal (TotemPlParser *parser,
if (!parse_data->recurse && parse_data->recurse_level > 0)
return TOTEM_PL_PARSER_RESULT_UNHANDLED;
+ uri = g_file_get_uri (file);
+
/* Should we try to parse it with quvi? */
if (g_file_has_uri_scheme (file, "http")) {
- char *url;
- url = g_file_get_uri (file);
- if (url != NULL && totem_pl_parser_is_videosite (url, parser->priv->debug) != FALSE) {
+ if (uri != NULL && totem_pl_parser_is_videosite (uri, parser->priv->debug) != FALSE) {
ret = totem_pl_parser_add_videosite (parser, file, base_file, parse_data, NULL);
- if (ret == TOTEM_PL_PARSER_RESULT_SUCCESS) {
- g_free (url);
+ if (ret == TOTEM_PL_PARSER_RESULT_SUCCESS)
return ret;
- }
}
- g_free (url);
}
/* In force mode we want to get the data */