Revision: 1946
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1946&view=rev
Author:   teuf
Date:     2008-02-03 10:53:28 -0800 (Sun, 03 Feb 2008)

Log Message:
-----------
Add comment about fields that aren't byteswapped, remove hardcoded int

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/src/db-artwork-parser.c
    libgpod/trunk/src/db-artwork-writer.c

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2008-02-03 18:40:55 UTC (rev 1945)
+++ libgpod/trunk/ChangeLog     2008-02-03 18:53:28 UTC (rev 1946)
@@ -1,5 +1,11 @@
 2008-02-03  Christophe Fergeau  <[EMAIL PROTECTED]>
 
+       * src/db-artwork-parser.c: use enum name instead of hardcoded int
+       * src/db-artwork-writer.c: add comments about values that aren't
+       swapped because they are 8 bit values
+
+2008-02-03  Christophe Fergeau  <[EMAIL PROTECTED]>
+
        * src/db-itunes-parser.h: merge ArtworkDB_MhodHeaderArtworkType3
        and MhodHeaderArtworkType1 into a single struct called
        ArtworkDB_MhodHeaderString

Modified: libgpod/trunk/src/db-artwork-parser.c
===================================================================
--- libgpod/trunk/src/db-artwork-parser.c       2008-02-03 18:40:55 UTC (rev 
1945)
+++ libgpod/trunk/src/db-artwork-parser.c       2008-02-03 18:53:28 UTC (rev 
1946)
@@ -375,7 +375,7 @@
            {  /* FIXME: type==1 is album name. type==2 seems to be
                * the transtition type between photos,
                * e.g. "Dissolve". Not handled yet. */
-           case 1:
+           case MHOD_ARTWORK_TYPE_ALBUM_NAME:
                album->name = g_strndup ((gchar *)mhod1->string,
                                         get_gint32(mhod1->string_len, 
ctx->byte_order));
                dump_mhod_type_1 (mhod1);

Modified: libgpod/trunk/src/db-artwork-writer.c
===================================================================
--- libgpod/trunk/src/db-artwork-writer.c       2008-02-03 18:40:55 UTC (rev 
1945)
+++ libgpod/trunk/src/db-artwork-writer.c       2008-02-03 18:53:28 UTC (rev 
1946)
@@ -304,13 +304,15 @@
                return -1;
            }
 
-           mhod->encoding = 2;
+           mhod->encoding = 2; /* 8 bit field, no need to byteswap */
+
            /* number of bytes of the string encoded in UTF-16 */
            mhod->string_len = get_gint32 (g2l * len, buffer->byte_order);
            padding = 4 - ( (total_bytes + g2l*len) % 4 );
            if (padding == 4)
                padding = 0;
-           mhod->padding_len = padding;
+           mhod->padding_len = padding; /* 8 bit field, no need to byteswap */
+
            total_bytes += g2l*len + padding;
 
            /* Make sure we have enough free space to write the string */
@@ -327,7 +329,7 @@
            g_free (utf16);
            break;
        case G_BIG_ENDIAN:
-           mhod->encoding = 1;
+           mhod->encoding = 1; /* 8 bit field, no need to byteswap */
             /* FIXME: len isn't initialized */
            mhod->string_len = get_gint32 (len, buffer->byte_order);
            /* pad string if necessary */
@@ -336,7 +338,8 @@
            padding = 4 - ( (total_bytes + len) % 4 );
            if (padding == 4)
                padding = 0;
-           mhod->padding_len = padding;
+           mhod->padding_len = padding; /* 8 bit field, no need to byteswap */
+
            /* Make sure we have enough free space to write the string */
            ipod_buffer_maybe_grow (buffer, len+padding);
            mhod = ipod_buffer_get_pointer (buffer);


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

Reply via email to