commit 4b9c2140867c515d953b57134bd174864fef7c88
Author: Nikias Bassen <[email protected]>
Date: Sat Oct 10 12:53:57 2009 +0200
write mhsd type 6
Newer iTunes versions write an mhsd with type 6 to the iTunesDB. While
its use is still unknown, write it to the iTunesDB we generate "just in
case".
src/itdb_itunesdb.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index be7defc..039e74b 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -5222,6 +5222,23 @@ static gboolean write_mhsd_albums (FExport *fexp)
return TRUE;
}
+static gboolean write_mhsd_type6 (FExport *fexp)
+{
+ gulong mhsd_seek;
+ WContents *cts;
+
+ g_return_val_if_fail (fexp, FALSE);
+ g_return_val_if_fail (fexp->itdb, FALSE);
+ g_return_val_if_fail (fexp->wcontents, FALSE);
+
+ cts = fexp->wcontents;
+ mhsd_seek = cts->pos; /* get position of mhsd header */
+ mk_mhsd (fexp, 6); /* write header */
+ mk_mhlt (fexp, 0); /* for now, produce an empty set */
+ fix_header (cts, mhsd_seek);
+ return TRUE;
+}
+
/* create a WContents structure */
static WContents *wcontents_new (const gchar *filename)
{
@@ -5405,7 +5422,7 @@ static gboolean itdb_write_file_internal (Itdb_iTunesDB
*itdb,
}
#endif
- mk_mhbd (fexp, 5); /* five mhsds */
+ mk_mhbd (fexp, 6); /* six mhsds */
/* write albums (mhsd type 4) */
if (!write_mhsd_albums (fexp)) {
@@ -5425,6 +5442,15 @@ static gboolean itdb_write_file_internal (Itdb_iTunesDB
*itdb,
goto err;
}
+ /* write empty mhsd type 6, whatever it is */
+ if (!fexp->error && !write_mhsd_type6 (fexp)) {
+ g_set_error (&fexp->error,
+ ITDB_FILE_ERROR,
+ ITDB_FILE_ERROR_ITDB_CORRUPT,
+ _("Error writing mhsd type 6"));
+ goto err;
+ }
+
/* write special podcast version mhsd (mhsd type 3) */
if (!fexp->error && !write_mhsd_playlists (fexp, 3)) {
g_set_error (&fexp->error,
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2