diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/db-artwork-writer.c | 6 | ||||
-rw-r--r-- | src/db-itunes-parser.h | 13 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/db-artwork-writer.c b/src/db-artwork-writer.c index 4c728e8..65fc089 100644 --- a/src/db-artwork-writer.c +++ b/src/db-artwork-writer.c @@ -41,7 +41,11 @@ #include <stdio.h> #include <sys/types.h> -#define IPOD_MMAP_SIZE 2 * 1024 * 1024 +/* FIXME: Writing aborts if a file exceeds the following size because + the mremap() further down will fail (at least most of the time on + most systems). As a workaround the size was increased from 2 MB to + 16 MB. */ +#define IPOD_MMAP_SIZE 16 * 1024 * 1024 struct iPodMmapBuffer { int fd; diff --git a/src/db-itunes-parser.h b/src/db-itunes-parser.h index a51af8b..bdd8498 100644 --- a/src/db-itunes-parser.h +++ b/src/db-itunes-parser.h @@ -29,12 +29,6 @@ #include <glib.h> /*#include "ipod-db-parser.h"*/ -/* Make sure that 64bit integers do not get padded */ -/* FIXME: Obviously, this could also affect 16bit and 32bit integers, - but so far all 32bit inters seem to be aligned correctly without - padding. */ -#pragma pack(4) - #define ITUNESDB_MAX_SIZE 10 * 1024 * 1024 struct _MHeader { @@ -529,7 +523,12 @@ struct _MhiiHeader { gint32 unknown8; gint32 orig_img_size; unsigned char padding[]; -}; +} __attribute__((__packed__)); +/* I we don't put the 'packed' attribute above, some 64 bit systems + * will pad the 64 bit integer to be aligned to an 8-byte boundary. + * Hopefully there won't be any systems around that crash when + * accessing 64 bit integers not aligned to 8-byte boundaries. */ + struct _MhniHeader { unsigned char header_id[4]; |