commit 360c67d3dd17abe664198245237032ab49ebf663
Author: Joel Smith <[email protected]>
Date: Wed Apr 14 21:49:54 2010 -0600
handle child atoms other than name in chapter parsing
Since chapters can have several child atoms besides name (such as url ,
urlt, or ploc/trak), the parser now properly skips them and only looks
at the name child atom
src/itdb_itunesdb.c | 31 +++++++++++++++++++------------
1 files changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index 5041676..b75c5a2 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -1530,26 +1530,33 @@ static MHODData get_mhod (FImport *fimp, glong
mhod_seek, guint32 *ml)
if (check_header_seek (cts, "chap", seek+4))
{
guint32 length;
+ guint32 childlength;
guint32 startpos;
+ guint32 children;
+ gint j;
gunichar2 *string_utf16;
startpos = get32bint (cts, seek+8);
+ children = get32bint (cts, seek+12);
seek += 20;
- if (check_header_seek (cts, "name", seek+4))
+ for (j=0; j<children; ++j)
{
- length = get16bint (cts, seek+20);
- string_utf16 = g_new0 (gunichar2, (length+1));
- if (!seek_get_n_bytes (cts, (gchar *)string_utf16,
- seek+22, length*2))
+ childlength = get32bint (cts, seek);
+ if (check_header_seek (cts, "name", seek+4))
{
+ length = get16bint (cts, seek+20);
+ string_utf16 = g_new0 (gunichar2, (length+1));
+ if (!seek_get_n_bytes (cts, (gchar *)string_utf16,
seek+22, length*2))
+ {
+ g_free (string_utf16);
+ itdb_chapterdata_free (result.data.chapterdata);
+ return result; /* *ml==-1, result.valid==FALSE
*/
+ }
+ fixup_big_utf16 (string_utf16);
+
itdb_chapterdata_add_chapter(result.data.chapterdata,startpos,g_utf16_to_utf8 (
+ string_utf16, -1, NULL, NULL, NULL));
g_free (string_utf16);
- itdb_chapterdata_free (result.data.chapterdata);
- return result; /* *ml==-1, result.valid==FALSE */
}
- fixup_big_utf16 (string_utf16);
-
itdb_chapterdata_add_chapter(result.data.chapterdata,startpos,g_utf16_to_utf8 (
- string_utf16, -1, NULL, NULL, NULL));
- g_free (string_utf16);
- seek += length * 2 + 22;
+ seek += childlength;
}
}
}
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2