Author: jbevain
Date: 2007-09-23 15:39:34 -0400 (Sun, 23 Sep 2007)
New Revision: 86248
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/playlist.cpp
Log:
2007-09-23 Jb Evain <[EMAIL PROTECTED]>
* playlist.cpp: A base element stores the base in
a href attribute, not in its body.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-09-23 18:29:00 UTC (rev 86247)
+++ trunk/moon/src/ChangeLog 2007-09-23 19:39:34 UTC (rev 86248)
@@ -1,3 +1,8 @@
+2007-09-23 Jb Evain <[EMAIL PROTECTED]>
+
+ * playlist.cpp: A base element stores the base in
+ a href attribute, not in its body.
+
2007-09-22 Chris Toshok <[EMAIL PROTECTED]>
* Makefile.am (USE_XRANDR): define USE_XRANDR.
Modified: trunk/moon/src/playlist.cpp
===================================================================
--- trunk/moon/src/playlist.cpp 2007-09-23 18:29:00 UTC (rev 86247)
+++ trunk/moon/src/playlist.cpp 2007-09-23 19:39:34 UTC (rev 86248)
@@ -229,6 +229,18 @@
return g_strcasecmp (candidate, tag) == 0;
}
+static bool
+has_href (const char **attrs)
+{
+ return attrs && str_match (*attrs, "HREF");
+}
+
+static char *
+get_href (const char **attrs)
+{
+ return g_strdup (*(attrs + 1));
+}
+
void
PlaylistParser::on_start_element (gpointer user_data, const char *name, const
char **attrs)
{
@@ -245,6 +257,8 @@
kind = Banner;
} else if (str_match (name, "BASE")) {
kind = Base;
+ if (has_href (attrs))
+ parser->GetCurrentContent ()->SetBase (get_href
(attrs));
} else if (str_match (name, "COPYRIGHT")) {
kind = Copyright;
} else if (str_match (name, "DURATION")) {
@@ -262,8 +276,8 @@
kind = StartTime;
} else if (str_match (name, "REF")) {
kind = Ref;
- if (attrs && str_match (*attrs, "HREF"))
- parser->GetCurrentEntry ()->SetSourceName (g_strdup
(*(attrs + 1)));
+ if (has_href (attrs))
+ parser->GetCurrentEntry ()->SetSourceName (get_href
(attrs));
} else if (str_match (name, "TITLE")) {
kind = Title;
} else {
@@ -303,7 +317,6 @@
break;
case Base:
parser->AssertParentKind (Asx | Entry);
- parser->GetCurrentContent ()->SetBase (g_strndup (data, len));
break;
case Copyright:
parser->AssertParentKind (Asx | Entry);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches