Revision: 1986
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1986&view=rev
Author: jcsjcs
Date: 2008-05-28 07:28:12 -0700 (Wed, 28 May 2008)
Log Message:
-----------
* src/db-artwork-parser.c (parse_mhii): removed artwork_fallback
variable upon Christophe's suggestion and streamlined code.
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/db-artwork-parser.c
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2008-05-28 13:31:53 UTC (rev 1985)
+++ libgpod/trunk/ChangeLog 2008-05-28 14:28:12 UTC (rev 1986)
@@ -1,5 +1,10 @@
2008-05-28 Jorg Schuler <jcsjcs at users.sourceforge.net>
+ * src/db-artwork-parser.c (parse_mhii): removed artwork_fallback
+ variable upon Christophe's suggestion and streamlined code.
+
+2008-05-28 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
* src/itdb_track.c (itdb_track_set_thumbnails_internal): set
artwork ID to 0 after removing thumbnails.
Modified: libgpod/trunk/src/db-artwork-parser.c
===================================================================
--- libgpod/trunk/src/db-artwork-parser.c 2008-05-28 13:31:53 UTC (rev
1985)
+++ libgpod/trunk/src/db-artwork-parser.c 2008-05-28 14:28:12 UTC (rev
1986)
@@ -251,9 +251,7 @@
off_t cur_offset;
Itdb_Artwork *artwork;
Itdb_PhotoDB *photodb;
- Itdb_iTunesDB *itunesdb;
guint64 mactime;
- Itdb_Artwork *artwork_fallback = NULL;
Itdb_Device *device = db_get_device (ctx->db);
mhii = db_parse_context_get_m_header (ctx, MhiiHeader, "mhii");
@@ -264,24 +262,7 @@
db_parse_context_set_total_len (ctx, get_gint32 (mhii->total_len,
ctx->byte_order));
dump_mhii (mhii);
- switch (ctx->db->db_type)
- {
- case DB_TYPE_PHOTO:
- photodb = db_get_photodb (ctx->db);
- g_return_val_if_fail (photodb, -1);
- artwork = itdb_artwork_new ();
- photodb->photos = g_list_append (photodb->photos, artwork);
- break;
- case DB_TYPE_ITUNES:
- itunesdb = db_get_itunesdb (ctx->db);
- g_return_val_if_fail (itunesdb, -1);
- artwork_fallback = itdb_artwork_new ();
- artwork = artwork_fallback;
- artwork->dbid = get_gint64 (mhii->song_id, ctx->byte_order);
- break;
- default:
- g_return_val_if_reached (-1);
- }
+ artwork = itdb_artwork_new ();
artwork->id = get_gint32 (mhii->image_id, ctx->byte_order);
artwork->unk028 = get_gint32 (mhii->unknown4, ctx->byte_order);
@@ -292,6 +273,7 @@
mactime = get_gint32 (mhii->digitized_date, ctx->byte_order);
artwork->digitized_date = device_time_mac_to_time_t (device, mactime);
artwork->artwork_size = get_gint32 (mhii->orig_img_size,
ctx->byte_order);
+ artwork->dbid = get_gint64 (mhii->song_id, ctx->byte_order);
cur_offset = ctx->header_len;
mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
@@ -306,14 +288,19 @@
}
g_free (mhod_ctx);
- /* make a copy of all artwork in ctx->artwork */
- if (ctx->artwork)
+ switch (ctx->db->db_type)
{
- if (artwork_fallback == NULL)
- {
- artwork_fallback = itdb_artwork_duplicate (artwork);
- }
- *ctx->artwork = g_list_prepend (*ctx->artwork, artwork_fallback);
+ case DB_TYPE_PHOTO:
+ photodb = db_get_photodb (ctx->db);
+ g_return_val_if_fail (photodb, -1);
+ photodb->photos = g_list_append (photodb->photos, artwork);
+ break;
+ case DB_TYPE_ITUNES:
+ g_return_val_if_fail (ctx->artwork!=NULL, -1);
+ *ctx->artwork = g_list_prepend (*ctx->artwork, artwork);
+ break;
+ default:
+ g_return_val_if_reached (-1);
}
return 0;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2