summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2007-11-07 12:04:47 +0000
committerBastien Nocera <hadess@src.gnome.org>2007-11-07 12:04:47 +0000
commitd45918b651b6390b9f10050671c03c796e7be4d4 (patch)
tree11c99c90e1212bd8d2b86a1ede0f6f1665322899
parentc8e7c04270fd90493ad520fe47b5395359c81678 (diff)
downloadtotem-d45918b651b6390b9f10050671c03c796e7be4d4.tar.gz
Add support for parsing M3U files with drive letters, as used on some
2007-11-07 Bastien Nocera <hadess@hadess.net> * src/plparse/totem-pl-parser-lines.c: (totem_pl_parser_add_m3u): Add support for parsing M3U files with drive letters, as used on some devices like the Sony Ericsson W950i (See #427975) svn path=/trunk/; revision=4861
-rw-r--r--ChangeLog6
-rw-r--r--src/plparse/totem-pl-parser-lines.c15
2 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4cfc70a74..9bb056725 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-07 Bastien Nocera <hadess@hadess.net>
+
+ * src/plparse/totem-pl-parser-lines.c: (totem_pl_parser_add_m3u):
+ Add support for parsing M3U files with drive letters, as used on
+ some devices like the Sony Ericsson W950i (See #427975)
+
2007-11-06 Bastien Nocera <hadess@hadess.net>
* src/plparse/totem-pl-parser-podcast.c: (parse_rss_items),
diff --git a/src/plparse/totem-pl-parser-lines.c b/src/plparse/totem-pl-parser-lines.c
index fbdec26b2..14a543619 100644
--- a/src/plparse/totem-pl-parser-lines.c
+++ b/src/plparse/totem-pl-parser-lines.c
@@ -418,6 +418,19 @@ totem_pl_parser_add_m3u (TotemPlParser *parser, const char *url,
totem_pl_parser_get_extinfo_title (extinfo, lines, i));
}
extinfo = FALSE;
+ } else if (g_ascii_isalpha (lines[i][0]) != FALSE
+ && g_str_has_prefix (lines[i] + 1, ":\\")) {
+ /* Path relative to a drive on Windows, we need to use
+ * the base that was passed to us */
+ char *fullpath;
+
+ lines[i] = g_strdelimit (lines[i], "\\", '/');
+ /* + 2, skip drive letter */
+ fullpath = totem_pl_parser_append_path (_base, lines[i] + 2);
+ totem_pl_parser_add_one_url (parser, fullpath,
+ totem_pl_parser_get_extinfo_title (extinfo, lines, i));
+ g_free (fullpath);
+ extinfo = FALSE;
} else if (lines[i][0] == '\\' && lines[i][1] == '\\') {
/* ... Or it's in the windows smb form
* (\\machine\share\filename), Note drive names
@@ -443,7 +456,7 @@ totem_pl_parser_add_m3u (TotemPlParser *parser, const char *url,
lines[i] = g_strdelimit (lines[i], "\\", '/');
fullpath = totem_pl_parser_append_path (base, lines[i]);
totem_pl_parser_add_one_url (parser, fullpath,
- totem_pl_parser_get_extinfo_title (extinfo, lines, i));
+ totem_pl_parser_get_extinfo_title (extinfo, lines, i));
g_free (fullpath);
g_free (base);
extinfo = FALSE;