You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
(4) |
Oct
(2) |
Nov
(20) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(2) |
Feb
(17) |
Mar
(30) |
Apr
(2) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(11) |
2005 |
Jan
|
Feb
(19) |
Mar
(7) |
Apr
(11) |
May
(6) |
Jun
(17) |
Jul
(12) |
Aug
(4) |
Sep
(114) |
Oct
(158) |
Nov
(151) |
Dec
(84) |
2006 |
Jan
(70) |
Feb
(75) |
Mar
(73) |
Apr
(135) |
May
(179) |
Jun
(75) |
Jul
(16) |
Aug
(105) |
Sep
(151) |
Oct
(85) |
Nov
(119) |
Dec
(98) |
2007 |
Jan
(190) |
Feb
(102) |
Mar
(61) |
Apr
(158) |
May
(131) |
Jun
(219) |
Jul
(173) |
Aug
(74) |
Sep
(165) |
Oct
(177) |
Nov
(42) |
Dec
(106) |
2008 |
Jan
(65) |
Feb
(13) |
Mar
(13) |
Apr
(60) |
May
(113) |
Jun
(32) |
Jul
(93) |
Aug
(33) |
Sep
(13) |
Oct
(30) |
Nov
(26) |
Dec
(48) |
2009 |
Jan
(49) |
Feb
(41) |
Mar
(25) |
Apr
(136) |
May
(18) |
Jun
(22) |
Jul
(27) |
Aug
(31) |
Sep
(17) |
Oct
(62) |
Nov
(25) |
Dec
(35) |
2010 |
Jan
(41) |
Feb
(33) |
Mar
(32) |
Apr
(87) |
May
(32) |
Jun
(21) |
Jul
(30) |
Aug
(53) |
Sep
(39) |
Oct
(22) |
Nov
(9) |
Dec
(20) |
2011 |
Jan
(27) |
Feb
(34) |
Mar
(63) |
Apr
(22) |
May
(18) |
Jun
(29) |
Jul
(23) |
Aug
(15) |
Sep
(12) |
Oct
(9) |
Nov
(12) |
Dec
(22) |
2012 |
Jan
(20) |
Feb
(3) |
Mar
(16) |
Apr
(4) |
May
(4) |
Jun
(4) |
Jul
(18) |
Aug
(4) |
Sep
(8) |
Oct
(15) |
Nov
(12) |
Dec
(10) |
2013 |
Jan
(7) |
Feb
(5) |
Mar
(7) |
Apr
(2) |
May
(13) |
Jun
(8) |
Jul
|
Aug
(6) |
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(3) |
2014 |
Jan
|
Feb
(11) |
Mar
(5) |
Apr
|
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(4) |
Jun
(1) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: phantomjinx <p.g...@ph...> - 2014-05-27 10:18:46
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 <snip> > Hi Paul, > > I installed a few missing dependencies from your list. However I still get a: **************** > checking for faad... no configure: WARNING: "Cannot find faad. Conversion from m4a to mp3 not > possible" M4A File Type .....: no **************** for both v2.1.4 and git > version. That's curious... didn't you experience such issue while running ./configure? > > Also, upgrading to gstreamer v1.0 looks great, but if I update (git pull) the gtkpod-code > revision I downloaded one week ago, it tells me that it's already up to date. > > Regards, Flavio This is anything to do with faad that I installed ii faad 2.7-8 ii gstreamer1.0-plugins-bad-faad:i386 1.2.3-1ubuntu2 ii libfaad-dev:i386 2.7-8 ii libfaad2:i386 2.7-8 This is the important part of the configure script: dnl Check for faad for use filetype_m4a plugin dnl ------------------------------------------------------------- have_faad="no" AC_CHECK_PROG(FAAD, faad, yes, no) if test "x$FAAD" = "xyes"; then have_faad="yes" else AC_MSG_WARN(["Cannot find faad. Conversion from m4a to mp3 not possible"]) fi Its looking for the actual binary 'faad', which gets installed to /usr/bin and belongs to the faad package. I have pushed the gstreamer upgrades to the repository. Are you using the sf updated git repo? This is the latest commit: https://sourceforge.net/p/gtkpod/code/ci/7439f2094d69185b5ec7b1b27b6a8137210cc215/ PGR - -- Paul Richardson * p.g...@ph... * p.g...@re... * pgr...@li... "I know exactly who reads the papers ... * The Daily Mirror is read by people who think they run the country. * The Guardian is read by people who think they ought to run the country. * The Times is read by people who do actually run the country. * The Daily Mail is read by the wives of the people who run the country. * The Financial Times is read by the people who own the country. * The Morning Star is read by the people who think the country ought to be run by another country. * The Daily Telegraph is read by the people who think it is." Jim Hacker, Yes Minister -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlOEZnIACgkQcthLMIwdEb1vaACfauSnd7TCw1ILFTyJv8xseLgp t14AnR4VAW+DLDJ4sIHQ1e5yGVVB8mGI =DXQ8 -----END PGP SIGNATURE----- |
From: phantomjinx <p.g...@ph...> - 2014-05-26 21:32:34
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/22/2014 11:00 PM, Flavio wrote: > Il 22/05/2014 23:00, phantomjinx ha scritto: >> Hi Flavio, It would appear that 14.04 has a number of issues presented by gtkpod. This is not >> the first request for information regarding mp4 support not working. At the moment, I run >> exclusively on Fedora so I need to get a 14.04 VM up and running. Hopefully I should manage >> it over the weekend and I'll try to understand whats missing. Regards PGR > > Sure, thanks for writing me back. I upgraded to v14.04 because it's a LTS (long term support), > so in theory it should get more security updates than v13.10 in the next years. Just for the > record, libgpod seems to compile flawlessy on 14.04. > > Regards, F. > Hey, Finally installed a ubuntu 14.04 and here be the results. * Downloaded gtkpod 2.1.4 from sourceforge * Installed build-essential \ autoconf \ automake \ flex \ gettext \ intltoot \ libtool \ libwebkitgtk-3.0-dev \ gstreamer0.10-plugins-base \ gstreamer0.10-plugins-good \ libgstreamer-plugins-base0.10-dev \ libgstreamer0.10-dev \ gstreamer0.10-plugins-bad-multiverse \ gstreamer0.10-plugins-bad \ gstreamer0.10-plugins-ugly \ libflac-dev \ libogg-dev \ libvorbis-dev \ libmp3lame-dev \ libclutter-gtk-1.0-dev \ libgpod-dev \ libanjuta-dev \ libgdl-3-dev \ libid3tag0-dev \ libbrasero-media3-dev \ libmusicbrainz3-dev \ libcurl4-openssl-dev \ libfaad-dev \ libfaad2 That lot has got me up a UI (albeit with horrible looking icons). I can add an m4a file to the local repository and edit its tag data. Haven't got as far as adding a file to an ipod but so far so good. In addition, I have pushed some updates to git that update dependencies to gstreamer 1.0. This with the help of dimstar. Curently looking at porting over the atomic parsley release from bitbucket, as mentioned by Jonathan Neuschäfer. Hopefully, these updates will form the basis of a 2.1.5 release. PGR - -- Paul Richardson * p.g...@ph... * p.g...@re... * pgr...@li... "I know exactly who reads the papers ... * The Daily Mirror is read by people who think they run the country. * The Guardian is read by people who think they ought to run the country. * The Times is read by people who do actually run the country. * The Daily Mail is read by the wives of the people who run the country. * The Financial Times is read by the people who own the country. * The Morning Star is read by the people who think the country ought to be run by another country. * The Daily Telegraph is read by the people who think it is." Jim Hacker, Yes Minister -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlODssIACgkQcthLMIwdEb25LwCgj8jeSR6qsrehrEaRZU03GsmE D1UAmwW+Z7lnX6zj63ypws9LAzjNi1Ze =moTZ -----END PGP SIGNATURE----- |
From: yuan z. <zha...@gm...> - 2014-05-13 15:19:05
|
the iTunesSD header format ( table below) of /iPod_Control/iTunes/iTunesSD generated by the gtkpod of version <=2.1.4 is 0x010600 which will cause the shuffle 2nd generation report ERR:No music loaded (alternate green and orange light). This can be easily solved by changing it to 0x010800 *Table 1 *: iTunesSD header format *field* *size* *value* num songs 3 Number of song entries in the file. unknown 3 0x010600? iTunes 7.2 puts 0x010800 here header size 3 size of the header (0x12, 18 byte header) unknown 9 possibly zero padding rest of header is NOT zero padded |
From: batguano999 <bat...@zo...> - 2014-03-26 06:03:50
|
>Ubuntu-14.04 is released soon. >I've tested Ubuntu-14.04-beta1 but the repository gtkpod-2.1.4 seems to be broken. >Says "Segmentation fault". > >So I need to compile gtkpod-2.1.4 or gtkpod-git myself. OK I've compiled gtkpod-2.1.4 with 32-bit Ubuntu-14.04-beta1 (but gtkpod-git failed to compile). $ sudo apt-get install build-essential checkinstall curl $ sudo apt-get build-dep gtkpod $ curl -L sourceforge.net/projects/gtkpod/files/gtkpod/gtkpod-2.1.4/gtkpod-2.1.4.tar.gz | tar -xz; cd gtkpod-2.1.4 $ ./configure $ make $ sudo checkinstall --pkgname gtkpod --pkgversion 2.1.4 --backup=no --default --deldoc=yes --fstrans=no; sudo ldconfig |
From: batguano999 <bat...@zo...> - 2014-03-26 01:41:07
|
Hi I have posted to gtkpod-questions, but didn't receive a reply. Maybe this list is more appropriate. Hi Ubuntu-14.04 is released soon. I've tested Ubuntu-14.04-beta1 but the repository gtkpod-2.1.4 seems to be broken. Says "Segmentation fault". So I need to compile gtkpod-2.1.4 or gtkpod-git myself. I previously did this some time ago with Ubuntu-12.04. Does anybody have any recent experience compiling gtkpod with Ubuntu? If so, which repo packages do I need to install, and which (if any) do I need to compile. |
From: Yasuhiro M. <mat...@gm...> - 2014-03-06 05:23:58
|
> How about this instead? > > diff --git a/src/itdb_sqlite.c b/src/itdb_sqlite.c > index b5b2975..23c645f 100644 > --- a/src/itdb_sqlite.c > +++ b/src/itdb_sqlite.c > @@ -2278,8 +2278,9 @@ int itdb_sqlite_generate_itdbs(FExport *fexp) > > tzoffset = fexp->itdb->tzoffset; > > - tmpdir = g_build_path(g_get_tmp_dir(), tmpnam(NULL), NULL); > - if (g_mkdir(tmpdir, 0755) != 0) { > + tmpdir = g_build_path(G_DIR_SEPARATOR_S, g_get_tmp_dir(), "libgpod.XXXXXX", NULL); > + > + if (!g_mkdtemp(tmpdir)) { > g_set_error (&fexp->error, G_FILE_ERROR, g_file_error_from_errno(errno), > "Could not create temporary directory '%s': %s", > tmpdir, strerror(errno)); > > mkstemp() creates a temporary file and returns its file-handle, > according to > https://developer.gnome.org/glib/2.37/glib-File-Utilities.html#g-mkstemp > (and, I think, in common with typical mkstemp() implementations). Your > patch caused libgpod.BLAH files to be created in the CWD, as well as > /tmp/libgpod.BLAH to be created. > > It looks like mkdtemp() is what we want, though I see there's a > g_dir_make_tmp() too. > > I don't know if this will work on Windows, but I imagine it should. Docs says: "the template should only be a basename, no directory components are allowed" So patch should be https://gist.github.com/mattn/9383016 But on windows, g_dir_make_tmp() is tool newer API. So I can't build it. And g_array_set_clear_func() is also newer APIs for windows. Currently, glib for windows is version 2.28.8 . I hope to revert with below's patch. Thanks. - Yasuhiro Matsumoto diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index a177e26..7fe178e 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -1155,7 +1155,7 @@ static gboolean playcounts_plist_read (FImport *fimp, GValue *plist_data) struct playcount *playcount; GHashTable *pc_dict, *track_dict; GValue *to_parse; - GArray *array; + GValueArray *array; gint i; guint32 mac_time; guint64 *dbid; @@ -1167,19 +1167,19 @@ static gboolean playcounts_plist_read (FImport *fimp, GValue *plist_data) if (to_parse == NULL) { return FALSE; } - if (!G_VALUE_HOLDS (to_parse, G_TYPE_ARRAY)) { + if (!G_VALUE_HOLDS (to_parse, G_TYPE_VALUE_ARRAY)) { return FALSE; } playcounts = g_hash_table_new_full (g_int64_hash, g_int64_equal, g_free, g_free); - array = (GArray*)g_value_get_boxed (to_parse); - for (i = 0; i < array->len; i++) { - if (!G_VALUE_HOLDS (g_array_index (array, GValue *, i), G_TYPE_HASH_TABLE)) { + array = (GValueArray*)g_value_get_boxed (to_parse); + for (i = 0; i < array->n_values; i++) { + if (!G_VALUE_HOLDS (g_value_array_get_nth (array, i), G_TYPE_HASH_TABLE)) { continue; } - track_dict = g_value_get_boxed (g_array_index (array, GValue *, i)); + track_dict = g_value_get_boxed (g_value_array_get_nth (array, i)); if (track_dict == NULL) continue; diff --git a/src/itdb_plist.c b/src/itdb_plist.c index 4104cb8..b0cfbf1 100644 --- a/src/itdb_plist.c +++ b/src/itdb_plist.c @@ -40,7 +40,7 @@ * - <integer> => G_TYPE_INT64 (gint64) * - <true/>, <false/> => G_TYPE_BOOLEAN (gboolean) * - <data> => G_TYPE_GSTRING (GString *) - * - <array> => G_TYPE_ARRAY (GArray *) + * - <array> => G_TYPE_VALUE_ARRAY (GValueArray *) * - <dict> => G_TYPE_HASH_TABLE (GHashTable *) */ #ifdef HAVE_CONFIG_H @@ -70,6 +70,7 @@ extern GQuark itdb_device_error_quark (void); static GValue *parse_node (xmlNode *a_node, GError **error); + static void value_free (GValue *val) { @@ -275,17 +276,17 @@ parse_array (xmlNode *a_node, GError **error) { xmlNode *cur_node = a_node->children; GValue *value; - GArray *array; + GValueArray *array; - array = g_array_new (FALSE, TRUE, sizeof(GValue)); - g_array_set_clear_func (array, (GDestroyNotify)g_value_unset); + array = g_value_array_new (4); while (cur_node != NULL) { if (get_parser_for_type (cur_node->name) != NULL) { GValue *cur_value; cur_value = parse_node (cur_node, error); if (cur_value != NULL) { - array = g_array_append_vals (array, cur_value, 1); + array = g_value_array_append (array, cur_value); + g_value_unset (cur_value); g_free (cur_value); } } @@ -298,11 +299,11 @@ parse_array (xmlNode *a_node, GError **error) } if ((error != NULL) && (*error != NULL)) { - g_array_unref (array); + g_value_array_free (array); return NULL; } value = g_new0 (GValue, 1); - value = g_value_init (value, G_TYPE_ARRAY); + value = g_value_init (value, G_TYPE_VALUE_ARRAY); g_value_take_boxed (value, array); return value; diff --git a/src/itdb_sysinfo_extended_parser.c b/src/itdb_sysinfo_extended_parser.c index 78dcf70..cc09c49 100644 --- a/src/itdb_sysinfo_extended_parser.c +++ b/src/itdb_sysinfo_extended_parser.c @@ -479,26 +479,26 @@ static GList *parse_one_formats_list (GHashTable *sysinfo_dict, { GValue *to_parse; GList *formats = NULL; - GArray *array; + GValueArray *array; gint i; to_parse = g_hash_table_lookup (sysinfo_dict, key); if (to_parse == NULL) { return NULL; } - if (!G_VALUE_HOLDS (to_parse, G_TYPE_ARRAY)) { + if (!G_VALUE_HOLDS (to_parse, G_TYPE_VALUE_ARRAY)) { return NULL; } - array = (GArray*)g_value_get_boxed (to_parse); - for (i = 0; i < array->len; i++) { + array = (GValueArray*)g_value_get_boxed (to_parse); + for (i = 0; i < array->n_values; i++) { Itdb_ArtworkFormat *format; /* SysInfoExtended on the iPhone has <string> fields in the artwork * format array in addition to the hash we parse */ - if (!G_VALUE_HOLDS (&g_array_index (array, GValue, i), G_TYPE_HASH_TABLE)) { + if (!G_VALUE_HOLDS (g_value_array_get_nth (array, i), G_TYPE_HASH_TABLE)) { continue; } - format = g_value_to_image_format (&g_array_index (array, GValue, i)); + format = g_value_to_image_format (g_value_array_get_nth (array, i)); if (format != NULL) { formats = g_list_prepend (formats, format); } |
From: Rory Y. <ror...@gm...> - 2014-03-05 12:50:38
|
[sent to Yasuhiro not list...] Hi Yasuhiro, How about this instead? diff --git a/src/itdb_sqlite.c b/src/itdb_sqlite.c index b5b2975..23c645f 100644 --- a/src/itdb_sqlite.c +++ b/src/itdb_sqlite.c @@ -2278,8 +2278,9 @@ int itdb_sqlite_generate_itdbs(FExport *fexp) tzoffset = fexp->itdb->tzoffset; - tmpdir = g_build_path(g_get_tmp_dir(), tmpnam(NULL), NULL); - if (g_mkdir(tmpdir, 0755) != 0) { + tmpdir = g_build_path(G_DIR_SEPARATOR_S, g_get_tmp_dir(), "libgpod.XXXXXX", NULL); + + if (!g_mkdtemp(tmpdir)) { g_set_error (&fexp->error, G_FILE_ERROR, g_file_error_from_errno(errno), "Could not create temporary directory '%s': %s", tmpdir, strerror(errno)); mkstemp() creates a temporary file and returns its file-handle, according to https://developer.gnome.org/glib/2.37/glib-File-Utilities.html#g-mkstemp (and, I think, in common with typical mkstemp() implementations). Your patch caused libgpod.BLAH files to be created in the CWD, as well as /tmp/libgpod.BLAH to be created. It looks like mkdtemp() is what we want, though I see there's a g_dir_make_tmp() too. I don't know if this will work on Windows, but I imagine it should. Regards, Rory Yasuhiro MATSUMOTO <mat...@gm...> writes: > Hi. > > libgpod manipulate sqlite3 db in temporary directory. But the temporary > directory is unexpected. > > tmpdir = g_build_path(g_get_tmp_dir(), tmpnam(NULL), NULL); > > This doesn't work correctly. IFAIK, g_build_path take path separator for > first argument. And if want to make temporary directory, it should be call > like follow. > > tmpdir = g_build_path(G_DIR_SEPARATOR_S, g_get_tmp_dir(), ...); > > I noticed one more bug. tmpnam(NULL) returns full path string on POSIX > environment. For example: > > UNIX: > ex: /tmp/a2aja35 > > Windows: > ex: \2s5s. > > I guess that this is not expected. Below is a patch. Please check and > include. > BTW, Right now, I came to be able to transfer the music in windows with > this patch. :) > > https://gist.github.com/mattn/9345867 > > > -- > - Yasuhiro Matsumoto > ------------------------------------------------------------------------------ > Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce. > With Perforce, you get hassle-free workflows. Merge that actually works. > Faster operations. Version large binaries. Built-in WAN optimization and the > freedom to use Git, Perforce or both. Make the move to Perforce. > http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk > _______________________________________________ > Gtkpod-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtkpod-devel |
From: Yasuhiro M. <mat...@gm...> - 2014-03-04 12:59:58
|
Hi. libgpod manipulate sqlite3 db in temporary directory. But the temporary directory is unexpected. tmpdir = g_build_path(g_get_tmp_dir(), tmpnam(NULL), NULL); This doesn't work correctly. IFAIK, g_build_path take path separator for first argument. And if want to make temporary directory, it should be call like follow. tmpdir = g_build_path(G_DIR_SEPARATOR_S, g_get_tmp_dir(), ...); I noticed one more bug. tmpnam(NULL) returns full path string on POSIX environment. For example: UNIX: ex: /tmp/a2aja35 Windows: ex: \2s5s. I guess that this is not expected. Below is a patch. Please check and include. BTW, Right now, I came to be able to transfer the music in windows with this patch. :) https://gist.github.com/mattn/9345867 -- - Yasuhiro Matsumoto |
From: Yasuhiro M. <mat...@gm...> - 2014-02-28 03:49:23
|
Hi I think that it's better to skip if model_name is just 'x'. On Thu, Feb 27, 2014 at 8:46 PM, Daniele Forsi <df...@gm...> wrote: > 2014-02-27 8:21 GMT+01:00 Yasuhiro MATSUMOTO: > > > Currently, some application (sorry i don't know) wrote SysInfo in below. > > /iPod_Control/Device/SysInfo > > And it seems that gtkpod expect xY000 like string. > > But some times this leading 'x' doesn't set. Maybe it depend on > > libmodiledevice or another libraries? > > Below is a patch for getting ModelNumStr old workaround. > > Please check and include. > > > > - Yasuhiro Matsumoto > > > > > > diff --git a/src/itdb_device.c b/src/itdb_device.c > > index 80995de..4f10675 100644 > > --- a/src/itdb_device.c > > +++ b/src/itdb_device.c > > @@ -2113,7 +2113,8 @@ get_ipod_info_from_model_number (const char > > *model_number) > > g_return_val_if_fail (model_number != NULL, NULL); > > > > model_table = get_model_table (); > > - if(isalpha(model_number[0])) { > > + /* Fix workarounds skipping leading 'x' */ > > + if(model_number[0] == 'x' && model_number[1] != '\0') { > > why are you testing model_number[1]? the original code didn't test it > > if you want the leading 'x' if present I would remove the comment and > just do that: > - if(isalpha(model_number[0])) { > + if (model_number[0] == 'x') { > > for consistency, it's better to add a space between "if" and the > opening parens (there are only 2 lines in this file where "if" isn't > followed by a space and 76 where it is followed by a space) > > -- > Daniele Forsi > > > ------------------------------------------------------------------------------ > Flow-based real-time traffic analytics software. Cisco certified tool. > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer > Customize your own dashboards, set traffic alerts and generate reports. > Network behavioral analysis & security monitoring. All-in-one tool. > > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk > _______________________________________________ > Gtkpod-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtkpod-devel > -- - Yasuhiro Matsumoto |
From: Yasuhiro M. <mat...@gm...> - 2014-02-28 00:50:16
|
Hi list. When libimobiledevice doesn't return expected value, we can get post proc commands via SysInfoExtra. How about this? diff --git a/src/itdb_sqlite.c b/src/itdb_sqlite.c index b5b2975..56c2506 100644 --- a/src/itdb_sqlite.c +++ b/src/itdb_sqlite.c @@ -1793,9 +1793,9 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, plist_node = NULL; } } - } else + } #endif - if (itdb->device->sysinfo_extended != NULL) { + if (ppc_dict == NULL && itdb->device->sysinfo_extended != NULL) { /* try to get SQL post process commands via sysinfo_extended */ gchar *dev_path = itdb_get_device_dir(itdb->device->mountpoint); if (dev_path) { - Yasuhiro Matsumoto |
From: Yasuhiro M. <mat...@gm...> - 2014-02-28 00:42:28
|
[snip] > [from URL above:] > > --- a/src/itdb_device.c > > +++ b/src/itdb_device.c > > @@ -1047,7 +1047,7 @@ gboolean itdb_device_read_sysinfo (Itdb_Device *device) > > gchar *ptr; > > gint len = strlen (buf); > > /* suppress newline at end of line */ > > - if ((len>0) && (buf[len-1]==0x0a)) > > + if ((len>0) && (buf[len-1]==0x0a || buf[len-1]==0x0d)) > > I don't know what this data is for, but (going with the comment) > shouldn't you strip newlines and carriage returns? So something like > (untested): > > while(len>0 && (buf[len-1]==0x0a || buf[len-1]==0x0d)) > { > buf[len-1]=0; > --len; > } > > And, again speaking from ignorance: it's not clear why the fopen() on > line 1041 of this file doesn't get the "rb" treatment like the other > fopen() calls. Yes, you are right. This should be triming carriage return. And this part doesn't need to be modified. So patch become below. diff --git a/src/itdb_artwork.c b/src/itdb_artwork.c index c595d70..14dc960 100644 --- a/src/itdb_artwork.c +++ b/src/itdb_artwork.c @@ -653,7 +653,7 @@ get_pixel_data (Itdb_Device *device, Itdb_Thumb_Ipod_Item *thumb) goto error; } - f = fopen (filename, "r"); + f = fopen (filename, "rb"); if (f == NULL) { g_print ("Failed to open %s: %s\n", filename, strerror (errno)); @@ -1108,7 +1108,7 @@ gboolean itdb_device_write_sysinfo (Itdb_Device *device, GError **error) if (devicedir) { gchar *sysfile = g_build_filename (devicedir, "SysInfo", NULL); - FILE *sysinfo = fopen (sysfile, "w"); + FILE *sysinfo = fopen (sysfile, "wb"); if (sysinfo) { if (device->sysinfo) @@ -1538,7 +1538,7 @@ static guint endianess_check_path (const gchar *path, const gchar *hdr) if (path) { - int fd = open (path, O_RDONLY); + int fd = open (path, O_RDONLY | O_BINARY); if (fd != -1) { gchar buf[4]; diff --git a/src/itdb_tzinfo.c b/src/itdb_tzinfo.c index 3c29947..a34eb36 100644 --- a/src/itdb_tzinfo.c +++ b/src/itdb_tzinfo.c @@ -98,7 +98,7 @@ static gboolean itdb_device_read_raw_timezone (const char *prefs_path, return FALSE; } - f = fopen (prefs_path, "r"); + f = fopen (prefs_path, "rb"); if (f == NULL) { return FALSE; } diff --git a/src/ithumb-writer.c b/src/ithumb-writer.c index 6b47aa6..a1e8dae 100644 --- a/src/ithumb-writer.c +++ b/src/ithumb-writer.c @@ -1262,7 +1262,7 @@ static gboolean ithumb_rearrange_thumbnail_file (gpointer _key, goto out; } - fd = open (filename, O_RDWR, 0); + fd = open (filename, O_RDWR | O_BINARY, 0); if (fd == -1) { *result = FALSE; -- - Yasuhiro Matsumoto |
From: Rory Y. <ror...@gm...> - 2014-02-27 15:17:47
|
Hi Yasuhiro, > Below is a patch. > Please check and include. > > https://gist.github.com/mattn/100bb84e2c5b5f54649d [from URL above:] > --- a/src/itdb_device.c > +++ b/src/itdb_device.c > @@ -1047,7 +1047,7 @@ gboolean itdb_device_read_sysinfo (Itdb_Device *device) > gchar *ptr; > gint len = strlen (buf); > /* suppress newline at end of line */ > - if ((len>0) && (buf[len-1]==0x0a)) > + if ((len>0) && (buf[len-1]==0x0a || buf[len-1]==0x0d)) I don't know what this data is for, but (going with the comment) shouldn't you strip newlines and carriage returns? So something like (untested): while(len>0 && (buf[len-1]==0x0a || buf[len-1]==0x0d)) { buf[len-1]=0; --len; } And, again speaking from ignorance: it's not clear why the fopen() on line 1041 of this file doesn't get the "rb" treatment like the other fopen() calls. Regards, Rory |
From: Daniele F. <df...@gm...> - 2014-02-27 11:47:04
|
2014-02-27 8:21 GMT+01:00 Yasuhiro MATSUMOTO: > Currently, some application (sorry i don't know) wrote SysInfo in below. > /iPod_Control/Device/SysInfo > And it seems that gtkpod expect xY000 like string. > But some times this leading 'x' doesn't set. Maybe it depend on > libmodiledevice or another libraries? > Below is a patch for getting ModelNumStr old workaround. > Please check and include. > > - Yasuhiro Matsumoto > > > diff --git a/src/itdb_device.c b/src/itdb_device.c > index 80995de..4f10675 100644 > --- a/src/itdb_device.c > +++ b/src/itdb_device.c > @@ -2113,7 +2113,8 @@ get_ipod_info_from_model_number (const char > *model_number) > g_return_val_if_fail (model_number != NULL, NULL); > > model_table = get_model_table (); > - if(isalpha(model_number[0])) { > + /* Fix workarounds skipping leading 'x' */ > + if(model_number[0] == 'x' && model_number[1] != '\0') { why are you testing model_number[1]? the original code didn't test it if you want the leading 'x' if present I would remove the comment and just do that: - if(isalpha(model_number[0])) { + if (model_number[0] == 'x') { for consistency, it's better to add a space between "if" and the opening parens (there are only 2 lines in this file where "if" isn't followed by a space and 76 where it is followed by a space) -- Daniele Forsi |
From: Yasuhiro M. <mat...@gm...> - 2014-02-27 07:21:40
|
Hi. Currently, some application (sorry i don't know) wrote SysInfo in below. /iPod_Control/Device/SysInfo And it seems that gtkpod expect xY000 like string. But some times this leading 'x' doesn't set. Maybe it depend on libmodiledevice or another libraries? Below is a patch for getting ModelNumStr old workaround. Please check and include. - Yasuhiro Matsumoto diff --git a/src/itdb_device.c b/src/itdb_device.c index 80995de..4f10675 100644 --- a/src/itdb_device.c +++ b/src/itdb_device.c @@ -2113,7 +2113,8 @@ get_ipod_info_from_model_number (const char *model_number) g_return_val_if_fail (model_number != NULL, NULL); model_table = get_model_table (); - if(isalpha(model_number[0])) { + /* Fix workarounds skipping leading 'x' */ + if(model_number[0] == 'x' && model_number[1] != '\0') { model_number++; } return g_hash_table_lookup (model_table->model_number_hash, model_number); |
From: Yasuhiro M. <mat...@gm...> - 2014-02-27 07:05:29
|
Hi. UUID in hashing parameters is not 20bytes always. https://github.com/denydias/libhashab#libgpod-extension-to-make-it-talk-to-ipod-nano-6th-generation On iPod nano 6g, uuid (mean FirewireGuid) 8bytes. So uuid contains bytes which isn't zero-filled. Below is a patch. Please check and include. diff --git a/src/itdb_device.c b/src/itdb_device.c index c72dd45..80995de 100644 --- a/src/itdb_device.c +++ b/src/itdb_device.c @@ -1899,7 +1899,7 @@ gboolean itdb_device_get_hex_uuid (const Itdb_Device *device, unsigned char uuid return FALSE; } memset (uuid, 0, 20); - result = itdb_hex_from_string (uuid, 20, uuid_str); + result = itdb_hex_from_string (uuid, strlen (uuid_str) / 2, uuid_str); return (result == 0); } -- - Yasuhiro Matsumoto |
From: Yasuhiro M. <mat...@gm...> - 2014-02-27 06:58:19
|
Hi list. I'm trying to port libgpod to windows. It seems libgpod read/write the files with fopen(name, "w"). So windows write "\r\n" with fputs. Below is a patch. Please check and include. https://gist.github.com/mattn/100bb84e2c5b5f54649d -- - Yasuhiro Matsumoto |
From: meuh m. <meu...@gm...> - 2014-02-16 17:24:35
|
Hi all, I'm trying to make and install gtkpod-2.1.4 on ubuntu 12.04. For now, the compilation fails... I'd like to fix it asap since I'm relying 100% on gtkpod for managing my iPod Classic from the first day I bought it. Thanks a lot for your help! m. OS: Ubuntu 12.04 kernel 3.5.0-45-generic x86_64 messages: ./config [checking] Core Configuration for gtkpod 2.1.4 : -------------------------------- Host System Type .....: x86_64-unknown-linux-gnu Install path .........: /usr/local GTK3 version .........: 3.4.2 GLib2/GThread version : 2.32.4 libgpod version ......: 0.8.2 Preprocessor .........: gcc Compiler .............: gcc -g -O2 -Wall -Wno-pointer-sign -std=gnu99 -Werror-implicit-function-declaration -Werror=format-security -pthread -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/libxml2 -I/usr/include/p11-kit-1 -I/usr/include/gpod-1.0 -pthread -I/usr/include/libxml2 -I/usr/include/gtk-3.0 -I/usr/include/libgdl-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/libanjuta-3.0 -pthread -I/usr/include/libgdl-3.0 -I/usr/include/gtk-3.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/libxml2 -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE -pthread -I/usr/include/clutter-1.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cogl -I/usr/include/cairo -I/usr/include/atk-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libdrm -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/gio-unix-2.0/ -I/usr/include/clutter-gtk-1.0 -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/brasero3 Linker ...............: gcc -no-undefined -Wl,--as-needed -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -lglib-2.0 -lgdk-3 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lglib-2.0 -pthread -lgthread-2.0 -lrt -lglib-2.0 -lgpod -lgdk_pixbuf-2.0 -limobiledevice -lgobject-2.0 -lglib-2.0 -lanjuta-3 -lgdl-3 -lgtk-3 -lxml2 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -lgdl-3 -lgtk-3 -lxml2 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -lxml2 -lid3tag -lz -pthread -lclutter-gtk-1.0 -lclutter-1.0 -lgtk-3 -lcogl-pango -ljson-glib-1.0 -lXi -lcogl -ldrm -lX11 -lXext -lXdamage -lXcomposite -lgmodule-2.0 -lrt -lXfixes -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -pthread -lgstbase-0.10 -lgstinterfaces-0.10 -lgstpbutils-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0 -pthread -lbrasero-media3 -lgthread-2.0 -lrt -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 Plugin Configuration : --------------------------------- CoverWeb Browser .....: yes Media Player .....: yes MP4 File Type .....: yes M4A File Type .....: yes Flac File Type .....: yes Ogg File Type .....: yes Clarity Display Widget .....: yes Sound Juicer Widget .....: yes Support for cover download .....: yes -- will build with coverart download support Now type 'make' to build gtkpod 2.1.4, and then 'make install' for installation. make make all-recursive make[1]: Entering directory `/home/mj/Downloads/gtkpod-2.1.4' Making all in libgtkpod make[2]: Entering directory `/home/mj/Downloads/gtkpod-2.1.4/libgtkpod' CC gtkpod_app_iface.lo CC filetype_iface.lo CC track_command_iface.lo CC exporter_iface.lo CC repository_editor_iface.lo CC details_editor_iface.lo CC lyrics_editor_iface.lo CC photo_editor_iface.lo CC gp_private.lo CC gp_itdb.lo CC charset.lo CC sha1.lo CC file.lo file.c: In function 'parse_offline_playcount': file.c:2042:18: warning: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Wunused-result] CC file_itunesdb.lo CC file_convert.lo CC fileselection.lo CC misc_track.lo CC prefs.lo CC syncdir.lo CC misc.lo CC misc_conversion.lo CC clientserver.lo clientserver.c: In function 'register_playcount': clientserver.c:126:26: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] clientserver.c:128:30: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] clientserver.c:129:26: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] clientserver.c:130:26: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] clientserver.c:131:26: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] CC directories.lo CC tools.lo tools.c: In function 'tools_sync_script': tools.c:595:9: warning: ignoring return value of 'pipe', declared with attribute warn_unused_result [-Wunused-result] CC misc_playlist.lo CC stock_icons.lo CC gtkpod_app-marshallers.lo CC tool_menu_action.lo CC context_menus.lo CC autodetection.lo CCLD libgtkpod.la make[2]: Leaving directory `/home/mj/Downloads/gtkpod-2.1.4/libgtkpod' Making all in libs make[2]: Entering directory `/home/mj/Downloads/gtkpod-2.1.4/libs' Making all in atomic-parsley make[3]: Entering directory `/home/mj/Downloads/gtkpod-2.1.4/libs/atomic-parsley' CXX AP_AtomExtracts.lo AP_AtomExtracts.cpp: In function 'Trackage* APar_ExtractDetails(FILE*, uint8_t)': AP_AtomExtracts.cpp:1380:158: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type 'uint64_t {aka long unsigned int}' [-Wformat] AP_AtomExtracts.cpp: In function 'void APar_ExtractBrands(char*)': AP_AtomExtracts.cpp:1416:31: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] CXX AP_commons.lo AP_commons.cpp: In function 'void APar_readX(char*, FILE*, uint32_t, uint32_t)': AP_commons.cpp:80:38: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AP_commons.cpp: In function 'uint32_t APar_read32(char*, FILE*, uint32_t)': AP_commons.cpp:74:33: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AP_commons.cpp: In function 'uint16_t APar_read16(char*, FILE*, uint32_t)': AP_commons.cpp:68:33: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AP_commons.cpp: In function 'uint8_t APar_read8(FILE*, uint32_t)': AP_commons.cpp:62:34: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] CXX AP_iconv.lo CXX APar_sha1.lo CXX APar_uuid.lo CXX AtomicParsley_genres.lo CXX AtomicParsley.lo AtomicParsley.cpp: In function 'char* APar_ExtractDataAtom(int)': AtomicParsley.cpp:1846:80: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t {aka long unsigned int}' [-Wformat] AtomicParsley.cpp: In function 'void APar_PrintAtomicTree()': AtomicParsley.cpp:2108:54: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type 'uint64_t {aka long unsigned int}' [-Wformat] AtomicParsley.cpp:2108:54: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 7 has type 'uint64_t {aka long unsigned int}' [-Wformat] AtomicParsley.cpp:2213:69: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t {aka long unsigned int}' [-Wformat] AtomicParsley.cpp: In function 'uint64_t APar_64bitAtomRead(FILE*, uint32_t)': AtomicParsley.cpp:2419:141: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t {aka long unsigned int}' [-Wformat] AtomicParsley.cpp: In function 'void APar_ValidateAtoms()': AtomicParsley.cpp:4717:73: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Wformat] AtomicParsley.cpp: In function 'uint32_t APar_WriteAtomically(FILE*, FILE*, bool, char*&, char*&, uint32_t, short int)': AtomicParsley.cpp:5000:67: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp:5011:110: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'void APar_MergeTempFile(FILE*, FILE*, uint32_t, uint32_t, char*&)': AtomicParsley.cpp:4928:60: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp:4947:76: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'void APar_MetadataFileDump(const char*)': AtomicParsley.cpp:4869:85: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'void APar_ScanAtoms(const char*, bool)': AtomicParsley.cpp:2599:37: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp:2616:45: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp:2748:99: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'uint64_t APar_64bitAtomRead(FILE*, uint32_t)': AtomicParsley.cpp:2411:42: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'void APar_Extract_stsd_codec(FILE*, uint32_t)': AtomicParsley.cpp:2397:35: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'char* APar_ExtractDataAtom(int)': AtomicParsley.cpp:1716:83: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'char* APar_ExtractAAC_Artwork(short int, char*, short int)': AtomicParsley.cpp:1660:85: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'void APar_Extract_uuid_binary_file(AtomicInfo*, const char*, char*)': AtomicParsley.cpp:1604:70: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'void APar_AtomicRead(short int)': AtomicParsley.cpp:1113:117: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] AtomicParsley.cpp: In function 'int APar_TestArtworkBinaryData(const char*)': AtomicParsley.cpp:346:40: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result] CXX AtomicParsleyBridge.lo CXXLD libatomicparsley.la make[3]: Leaving directory `/home/mj/Downloads/gtkpod-2.1.4/libs/atomic-parsley' make[3]: Entering directory `/home/mj/Downloads/gtkpod-2.1.4/libs' make[3]: Nothing to be done for `all-am'. make[3]: Leaving directory `/home/mj/Downloads/gtkpod-2.1.4/libs' make[2]: Leaving directory `/home/mj/Downloads/gtkpod-2.1.4/libs' Making all in src make[2]: Entering directory `/home/mj/Downloads/gtkpod-2.1.4/src' CC anjuta-about.o CC anjuta-action-callbacks.o CC anjuta-window.o anjuta-window.c: In function ‘anjuta_window_dispose’: anjuta-window.c:419:3: error: implicit declaration of function ‘gdl_dock_layout_get_master’ [-Werror=implicit-function-declaration] anjuta-window.c:419:3: warning: passing argument 1 of ‘g_signal_handlers_disconnect_matched’ makes pointer from integer without a cast [enabled by default] /usr/include/glib-2.0/gobject/gsignal.h:403:8: note: expected ‘gpointer’ but argument is of type ‘int’ anjuta-window.c: In function ‘anjuta_window_instance_init’: anjuta-window.c:494:5: warning: passing argument 1 of ‘gdl_dock_bar_new’ from incompatible pointer type [enabled by default] /usr/include/libgdl-3.0/gdl/gdl-dock-bar.h:63:12: note: expected ‘struct GdlDock *’ but argument is of type ‘struct GObject *’ anjuta-window.c:498:5: warning: passing argument 1 of ‘gdl_dock_layout_new’ from incompatible pointer type [enabled by default] /usr/include/libgdl-3.0/gdl/gdl-dock-layout.h:63:18: note: expected ‘struct GdlDock *’ but argument is of type ‘struct GObject *’ cc1: some warnings being treated as errors make[2]: *** [anjuta-window.o] Error 1 make[2]: Leaving directory `/home/mj/Downloads/gtkpod-2.1.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/mj/Downloads/gtkpod-2.1.4' make: *** [all] Error 2 |
From: Rory Y. <ror...@gm...> - 2014-02-16 06:37:46
|
All printf(...) and fprintf(stderr,...) calls are replaced by itdb_log_debug(...) and itdb_log_error(...); the behaviour of the latter is controlled by an environment variable ITDB_LOGLEVEL. Not all calls were replaced; those inside preprocessor conditionals (e.g. "#if ITUNESDB_DEBUG") were not replaced, and no commented-out code was changed. --- src/Makefile.am | 2 + src/itdb_artwork.c | 2 +- src/itdb_hash72.c | 5 +- src/itdb_hashAB.c | 3 +- src/itdb_iphone.c | 62 ++++++------ src/itdb_itunesdb.c | 3 +- src/itdb_logger.c | 59 ++++++++++++ src/itdb_logger.h | 96 +++++++++++++++++++ src/itdb_sqlite.c | 270 ++++++++++++++++++++++++++-------------------------- 9 files changed, 331 insertions(+), 171 deletions(-) create mode 100644 src/itdb_logger.c create mode 100644 src/itdb_logger.h diff --git a/src/Makefile.am b/src/Makefile.am index 26fd515..56b815d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,6 +14,7 @@ libgpod_la_SOURCES = \ itdb_hashAB.c \ itdb_iphone.c \ itdb_itunesdb.c \ + itdb_logger.c \ itdb_photoalbum.c \ itdb_playlist.c \ itdb_plist.c \ @@ -42,6 +43,7 @@ noinst_HEADERS = \ db-parse-context.h \ itdb_device.h \ itdb_endianness.h \ + itdb_logger.h \ itdb_plist.h \ itdb_private.h \ itdb_sqlite_queries.h \ diff --git a/src/itdb_artwork.c b/src/itdb_artwork.c index c595d70..6590c1d 100644 --- a/src/itdb_artwork.c +++ b/src/itdb_artwork.c @@ -489,7 +489,7 @@ unpack_experimental (guint16 *pixels, guint bytes_len, guint byte_order, guint32 cur_pixel; /* FIXME: endianness */ cur_pixel = get_gint32 (rpixels[i], byte_order); -printf ("%8x\n", cur_pixel); +itdb_log_debug ("%8x\n", cur_pixel); /* Unpack pixels */ result[3*i] = (cur_pixel & RED_MASK_888) >> RED_SHIFT_888; result[3*i+1] = (cur_pixel & GREEN_MASK_888) >> GREEN_SHIFT_888; diff --git a/src/itdb_hash72.c b/src/itdb_hash72.c index ce61757..c893e00 100644 --- a/src/itdb_hash72.c +++ b/src/itdb_hash72.c @@ -35,6 +35,7 @@ #include "itdb_device.h" #include "db-itunes-parser.h" #include "itdb_private.h" +#include "itdb_logger.h" static const uint8_t AES_KEY[16] = { 0x61, 0x8c, 0xa1, 0x0d, 0xc7, 0xf5, 0x7f, 0xd3, 0xb4, 0x72, 0x3e, 0x08, 0x15, 0x74, 0x63, 0xd7 }; @@ -77,7 +78,7 @@ static int hash_extract(const uint8_t signature[46], uint8_t plaintext[32] = { 0 }, output[32] = { 0 }; if (signature[0] != 0x01 || signature[1] != 0x00) { - fprintf(stderr, "Invalid signature prefix!\n"); + itdb_log_error("Invalid signature prefix!\n"); return -1; } @@ -90,7 +91,7 @@ static int hash_extract(const uint8_t signature[46], aes_decrypt(plaintext, (uint8_t *)&signature[14], output, 16); if (memcmp(&plaintext[16], &output[16], 16)) { - fprintf(stderr, "uh oh\n"); + itdb_log_error("uh oh\n"); return -1; } diff --git a/src/itdb_hashAB.c b/src/itdb_hashAB.c index 7b9f833..b02178d 100644 --- a/src/itdb_hashAB.c +++ b/src/itdb_hashAB.c @@ -36,6 +36,7 @@ #include "itdb_device.h" #include "db-itunes-parser.h" #include "itdb_private.h" +#include "itdb_logger.h" typedef void (*calcHashAB_t)(unsigned char target[57], const unsigned char sha1[20], const unsigned char uuid[20], const unsigned char rnd_bytes[23]); static calcHashAB_t calc_hashAB = NULL; @@ -62,7 +63,7 @@ static gboolean load_libhashab() } g_module_make_resident(handle); - printf("***** hashAB support successfully loaded *****\n"); + itdb_log_debug("***** hashAB support successfully loaded *****\n"); return TRUE; } diff --git a/src/itdb_iphone.c b/src/itdb_iphone.c index 694a701..6187af5 100644 --- a/src/itdb_iphone.c +++ b/src/itdb_iphone.c @@ -50,7 +50,7 @@ static int itdb_iphone_post_notification(idevice_t device, lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &service); if (!service || !service->port) { - fprintf(stderr, "notification_proxy could not be started!\n"); + itdb_log_error("notification_proxy could not be started!\n"); return -1; } @@ -60,7 +60,7 @@ static int itdb_iphone_post_notification(idevice_t device, lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &nport); if (!nport) { - fprintf(stderr, "notification_proxy could not be started!\n"); + itdb_log_error("notification_proxy could not be started!\n"); return -1; } @@ -68,12 +68,12 @@ static int itdb_iphone_post_notification(idevice_t device, #endif if(!np) { - fprintf(stderr, "connection to notification_proxy failed!\n"); + itdb_log_error("connection to notification_proxy failed!\n"); return -1; } if(np_post_notification(np, notification)) { - fprintf(stderr, "failed to post notification!\n"); + itdb_log_error("failed to post notification!\n"); np_client_free(np); return -1; } @@ -99,24 +99,24 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) uuid = itdb_device_get_uuid (device); if (!uuid) { - fprintf(stderr, "Couldn't find get device UUID itdbprep processing won't work!"); + itdb_log_error("Couldn't find get device UUID itdbprep processing won't work!"); return -ENODEV; } - printf("libitdbprep: %s called with uuid=%s\n", __func__, uuid); + itdb_log_debug("libitdbprep: %s called with uuid=%s\n", __func__, uuid); *prepdata = NULL; pdata_loc = g_new0 (struct itdbprep_int, 1); res = idevice_new(&pdata_loc->device, uuid); if (IDEVICE_E_SUCCESS != res) { - fprintf(stderr, "No iPhone found, is it plugged in?\n"); + itdb_log_error("No iPhone found, is it plugged in?\n"); res = -ENODEV; goto leave_with_err; } if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(pdata_loc->device, &client, "libgpod")) { - fprintf(stderr, "Error: Could not establish lockdownd connection!\n"); + itdb_log_error("Error: Could not establish lockdownd connection!\n"); res = -1; goto leave_with_err; } @@ -124,7 +124,7 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) #ifdef HAVE_LIBIMOBILEDEVICE_1_1_5 lockdownd_start_service(client, "com.apple.afc", &service); if (!service || !service->port) { - fprintf(stderr, "Error: Could not start AFC service!\n"); + itdb_log_error("Error: Could not start AFC service!\n"); res = -1; goto leave_with_err; } @@ -132,44 +132,44 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) #else lockdownd_start_service(client, "com.apple.afc", &afcport); if (!afcport) { - fprintf(stderr, "Error: Could not start AFC service!\n"); + itdb_log_error("Error: Could not start AFC service!\n"); res = -1; goto leave_with_err; } afc_client_new(pdata_loc->device, afcport, &pdata_loc->afc); #endif if (!pdata_loc->afc) { - fprintf(stderr, "Error: Could not start AFC client!\n"); + itdb_log_error("Error: Could not start AFC client!\n"); res = -1; goto leave_with_err; } if (itdb_iphone_post_notification(pdata_loc->device, client, NP_SYNC_WILL_START)) { - fprintf(stderr, "could not post syncWillStart notification!\n"); + itdb_log_error("could not post syncWillStart notification!\n"); res = -1; goto leave_with_err; } - printf("%s: posted syncWillStart\n", __func__); + itdb_log_debug("%s: posted syncWillStart\n", __func__); sync_starting = 1; /* OPEN AND LOCK /com.apple.itunes.lock_sync */ afc_file_open(pdata_loc->afc, "/com.apple.itunes.lock_sync", AFC_FOPEN_RW, &pdata_loc->lockfile); if (!pdata_loc->lockfile) { - fprintf(stderr, "could not open lockfile\n"); + itdb_log_error("could not open lockfile\n"); res = -1; goto leave_with_err; } if (itdb_iphone_post_notification(pdata_loc->device, client, "com.apple.itunes-mobdev.syncLockRequest")) { - fprintf(stderr, "could not post syncLockRequest\n"); + itdb_log_error("could not post syncLockRequest\n"); res = -1; goto leave_with_err; } - printf("%s: posted syncLockRequest\n", __func__); + itdb_log_debug("%s: posted syncLockRequest\n", __func__); for (i=0; i<LOCK_ATTEMPTS; i++) { - fprintf(stderr, "Locking for sync, attempt %d...\n", i); + itdb_log_error("Locking for sync, attempt %d...\n", i); res = afc_file_lock(pdata_loc->afc, pdata_loc->lockfile, AFC_LOCK_EX); if (res == AFC_E_SUCCESS) { break; @@ -177,23 +177,23 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) usleep(LOCK_WAIT); continue; } else { - fprintf(stderr, "ERROR: could not lock file! error code: %d\n", res); + itdb_log_error("ERROR: could not lock file! error code: %d\n", res); res = -1; goto leave_with_err; } } if (i == LOCK_ATTEMPTS) { - fprintf(stderr, "ERROR: timeout while locking for sync\n"); + itdb_log_error("ERROR: timeout while locking for sync\n"); res = -1; goto leave_with_err; } if (itdb_iphone_post_notification(pdata_loc->device, client, NP_SYNC_DID_START)) { - fprintf(stderr, "could not post syncDidStart\n"); + itdb_log_error("could not post syncDidStart\n"); res = -1; goto leave_with_err; } - printf("%s: posted syncDidStart\n", __func__); + itdb_log_debug("%s: posted syncDidStart\n", __func__); lockdownd_client_free(client); client = NULL; @@ -205,7 +205,7 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) leave_with_err: if (client && sync_starting) { itdb_iphone_post_notification(pdata_loc->device, client, "com.apple.itunes-mobdev.syncFailedToStart"); - printf("%s: posted syncFailedToStart\n", __func__); + itdb_log_debug("%s: posted syncFailedToStart\n", __func__); } if (pdata_loc) { @@ -241,44 +241,44 @@ int itdb_iphone_stop_sync(void *sync_ctx) lockdownd_client_t client = NULL; itdbprep_t prepdata = sync_ctx; - printf("libitdbprep: %s called\n", __func__); + itdb_log_debug("libitdbprep: %s called\n", __func__); if (!prepdata) { - printf("%s called but prepdata is NULL!\n", __func__); + itdb_log_debug("%s called but prepdata is NULL!\n", __func__); return -1; } if (!prepdata->afc) { - printf("%s called but prepdata->afc is NULL!\n", __func__); + itdb_log_debug("%s called but prepdata->afc is NULL!\n", __func__); } else { /* remove .status-com.apple.itdbprep.command.runPostProcess */ if (afc_remove_path(prepdata->afc, "/iTunes_Control/iTunes/iTunes Library.itlp/DBTemp/.status-com.apple.itdprep.command.runPostProcess") != IDEVICE_E_SUCCESS) { - fprintf(stderr, "Could not delete '.status-com.apple.itdprep.command.runPostProcess'\n"); + itdb_log_error("Could not delete '.status-com.apple.itdprep.command.runPostProcess'\n"); } /* remove ddd.itdbm */ if (afc_remove_path(prepdata->afc, "/iTunes_Control/iTunes/iTunes Library.itlp/DBTemp/ddd.itdbm") != IDEVICE_E_SUCCESS) { - fprintf(stderr, "Could not delete 'ddd.itdbm'\n"); + itdb_log_error("Could not delete 'ddd.itdbm'\n"); } if (prepdata->lockfile) { afc_file_lock(prepdata->afc, prepdata->lockfile, AFC_LOCK_UN); afc_file_close(prepdata->afc, prepdata->lockfile); prepdata->lockfile = 0; } else { - printf("%s called but lockfile is 0\n", __func__); + itdb_log_debug("%s called but lockfile is 0\n", __func__); } afc_client_free(prepdata->afc); prepdata->afc = NULL; } if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(prepdata->device, &client, "libgpod")) { - fprintf(stderr, "Error: Could not establish lockdownd connection!\n"); + itdb_log_error("Error: Could not establish lockdownd connection!\n"); goto leave; } if(itdb_iphone_post_notification(prepdata->device, client, NP_SYNC_DID_FINISH)) { - fprintf(stderr, "failed to post syncDidFinish\n"); + itdb_log_error("failed to post syncDidFinish\n"); } - printf("%s: posted syncDidFinish\n", __func__); + itdb_log_debug("%s: posted syncDidFinish\n", __func__); lockdownd_client_free(client); diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index a177e26..cd0e97a 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -112,6 +112,7 @@ #include "itdb_private.h" #include "itdb_zlib.h" #include "itdb_plist.h" +#include "itdb_logger.h" #include <errno.h> #include <fcntl.h> @@ -4270,7 +4271,7 @@ static gunichar2 jump_table_letter (gchar *p) upperchr = g_unichar_toupper (chr); str = g_ucs4_to_utf16 (&upperchr, 1, NULL, NULL, &err); if (err != NULL) { - fprintf (stderr, "Error in UCS4 to UTF16 conversion: %s, original unichar: %x, toupper unichar: %x\n", err->message, chr, upperchr); + itdb_log_error("Error in UCS4 to UTF16 conversion: %s, original unichar: %x, toupper unichar: %x\n", err->message, chr, upperchr); g_error_free (err); return '0'; } diff --git a/src/itdb_logger.c b/src/itdb_logger.c new file mode 100644 index 0000000..6dc676b --- /dev/null +++ b/src/itdb_logger.c @@ -0,0 +1,59 @@ +/* +| Copyright (C) 2014 Rory Yorke <roryyorke at gmail.com> +| Part of the gtkpod project. +| +| URL: http://www.gtkpod.org/ +| URL: http://gtkpod.sourceforge.net/ +| +| The itdb_logger module provides a simple, run-time controllable +| capability for logging debug and error messages to the standard +| error stream. +| +| The code contained in this file is free software; you can redistribute +| it and/or modify it under the terms of the GNU Lesser General Public +| License as published by the Free Software Foundation; either version +| 2.1 of the License, or (at your option) any later version. +| +| This file is distributed in the hope that it will be useful, +| but WITHOUT ANY WARRANTY; without even the implied warranty of +| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +| Lesser General Public License for more details. +| +| You should have received a copy of the GNU Lesser General Public +| License along with this code; if not, write to the Free Software +| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +| +| iTunes and iPod are trademarks of Apple +| +| This product is not supported/written/published by Apple! +| +*/ +#include <stdarg.h> /* vfprintf */ +#include <stdio.h> /* vfprintf */ +#include <stdlib.h> /* getenv, strtol */ + +#include "itdb_logger.h" + +#define ITDB_LOGLEVEL_NAME "ITDB_LOGLEVEL" + +void itdb_log(int message_level, const char *fmt, ...) +{ + char const *loglevelstring = getenv(ITDB_LOGLEVEL_NAME); + + if(loglevelstring && *loglevelstring) + { /* env var exists and is non-empty */ + char *endptr=0; + long loglevel= strtol(loglevelstring, &endptr, 10); + if(!*endptr) + { /* entire string is valid */ + if(message_level<=loglevel) + { + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fflush(stderr); + } + } + } +} diff --git a/src/itdb_logger.h b/src/itdb_logger.h new file mode 100644 index 0000000..b474832 --- /dev/null +++ b/src/itdb_logger.h @@ -0,0 +1,96 @@ +/* +| Copyright (C) 2014 Rory Yorke <roryyorke at gmail.com> +| Part of the gtkpod project. +| +| URL: http://www.gtkpod.org/ +| URL: http://gtkpod.sourceforge.net/ +| +| The itdb_logger module provides a simple, run-time controllable +| capability for logging debug and error messages to the standard +| error stream. +| +| The code contained in this file is free software; you can redistribute +| it and/or modify it under the terms of the GNU Lesser General Public +| License as published by the Free Software Foundation; either version +| 2.1 of the License, or (at your option) any later version. +| +| This file is distributed in the hope that it will be useful, +| but WITHOUT ANY WARRANTY; without even the implied warranty of +| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +| Lesser General Public License for more details. +| +| You should have received a copy of the GNU Lesser General Public +| License along with this code; if not, write to the Free Software +| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +| +| iTunes and iPod are trademarks of Apple +| +| This product is not supported/written/published by Apple! +| +*/ +#ifndef __ITDB_LOGGER_H__ +#define __ITDB_LOGGER_H__ + +#include <glib.h> + +G_BEGIN_DECLS + +/* G_GNUC_INTERNAL is defined in glib 2.6 */ +#ifndef G_GNUC_INTERNAL +#define G_GNUC_INTERNAL +#endif + +/** + * ITDB_LOG_ERROR: + * + * Tag for error-level logging + * + * Since: TBD + */ +#define ITDB_LOG_ERROR 1 + +/** + * ITDB_LOG_DEBUG: + * Tag for debug-level logging + * + * Since: TBD + */ +#define ITDB_LOG_DEBUG 2 + +/** + * itdb_log: + * + * Log a message + * + * @message_level Log level of message + * @fmt printf-style format string + * @... print-style arguments + * + * If message_level is less than or equal to the current log level + * (determined by environment variable ITDB_LOGLEVEL), the message is + * printed to standard error stream. + * + * Since: TBD + */ +void itdb_log(int message_level, const char *fmt, ...) + __attribute__ ((format (printf, 2, 3))); + +/** + * itdb_log_error: + * + * Convenience macro for calling itdb_log with message level ITDB_LOG_ERROR. + */ +#define itdb_log_error(...) \ + itdb_log(ITDB_LOG_ERROR, __VA_ARGS__) + +/** + * itdb_log_debug: + * + * Convenience macro for calling itdb_log with message level ITDB_LOG_DEBUG. + */ +#define itdb_log_debug(...) \ + itdb_log(ITDB_LOG_DEBUG, __VA_ARGS__) + +G_END_DECLS + +#endif /* ifndef __ITDB_LOGGER_H__ */ diff --git a/src/itdb_sqlite.c b/src/itdb_sqlite.c index b5b2975..b1f56d3 100644 --- a/src/itdb_sqlite.c +++ b/src/itdb_sqlite.c @@ -42,7 +42,7 @@ #include "itdb.h" #include "itdb_private.h" #include "itdb_sqlite_queries.h" - +#include "itdb_logger.h" /** time zone offset in seconds */ static uint32_t tzoffset = 0; @@ -192,35 +192,35 @@ static int mk_Dynamic(Itdb_iTunesDB *itdb, const char *outpath) GList *gl = NULL; dbf = g_build_filename(outpath, "Dynamic.itdb", NULL); - printf("[%s] Processing '%s'\n", __func__, dbf); + itdb_log_debug("[%s] Processing '%s'\n", __func__, dbf); if (stat(dbf, &fst) != 0) { if (errno == ENOENT) { /* file is not present. so we'll create it */ } else { - fprintf(stderr, "[%s] Error: stat: %s\n", __func__, strerror(errno)); + itdb_log_error("[%s] Error: stat: %s\n", __func__, strerror(errno)); goto leave; } } else { /* file is present. delete it, we'll re-create it. */ if (unlink(dbf) != 0) { - fprintf(stderr, "[%s] could not delete '%s': %s\n", __func__, dbf, strerror(errno)); + itdb_log_error("[%s] could not delete '%s': %s\n", __func__, dbf, strerror(errno)); goto leave; } } if (SQLITE_OK != sqlite3_open((const char*)dbf, &db)) { - fprintf(stderr, "Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); + itdb_log_error("Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); goto leave; } sqlite3_exec(db, "PRAGMA synchronous = OFF;", NULL, NULL, NULL); - fprintf(stderr, "[%s] creating table structure\n", __func__); + itdb_log_error("[%s] creating table structure\n", __func__); /* db structure needs to be created. */ if (SQLITE_OK != sqlite3_exec(db, Dynamic_create, NULL, NULL, &errmsg)) { - fprintf(stderr, "[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); if (errmsg) { - fprintf(stderr, "[%s] additional error information: %s\n", __func__, errmsg); + itdb_log_error("[%s] additional error information: %s\n", __func__, errmsg); sqlite3_free(errmsg); errmsg = NULL; } @@ -230,9 +230,9 @@ static int mk_Dynamic(Itdb_iTunesDB *itdb, const char *outpath) sqlite3_exec(db, "BEGIN;", NULL, NULL, NULL); if (itdb->tracks) { - printf("[%s] - processing %d tracks\n", __func__, g_list_length(itdb->tracks)); + itdb_log_debug("[%s] - processing %d tracks\n", __func__, g_list_length(itdb->tracks)); if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"item_stats\" (item_pid,has_been_played,date_played,play_count_user,play_count_recent,date_skipped,skip_count_user,skip_count_recent,bookmark_time_ms,bookmark_time_ms_common,user_rating,user_rating_common) VALUES(?,?,?,?,?,?,?,?,?,?,?,?);", -1, &stmt, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } for (gl=itdb->tracks; gl; gl=gl->next) { @@ -242,7 +242,7 @@ static int mk_Dynamic(Itdb_iTunesDB *itdb, const char *outpath) } res = sqlite3_reset(stmt); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } idx = 0; /* item_pid */ @@ -276,7 +276,7 @@ static int mk_Dynamic(Itdb_iTunesDB *itdb, const char *outpath) if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 1 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_step returned %d\n", __func__, res); } } if (stmt) { @@ -284,22 +284,22 @@ static int mk_Dynamic(Itdb_iTunesDB *itdb, const char *outpath) stmt = NULL; } } else { - printf("[%s] - No tracks available, none written.\n", __func__); + itdb_log_debug("[%s] - No tracks available, none written.\n", __func__); } /* add playlist info to container_ui */ if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"container_ui\" VALUES(?,?,?,?,?,?,?);", -1, &stmt, NULL)) { - fprintf(stderr, "[%s] 2 sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] 2 sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } - printf("[%s] - processing %d playlists\n", __func__, g_list_length(itdb->playlists)); + itdb_log_debug("[%s] - processing %d playlists\n", __func__, g_list_length(itdb->playlists)); for (gl = itdb->playlists; gl; gl = gl->next) { Itdb_Playlist *pl = (Itdb_Playlist*)gl->data; res = sqlite3_reset(stmt); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 2 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 2 sqlite3_reset returned %d\n", __func__, res); } idx = 0; /* container_pid */ @@ -332,7 +332,7 @@ static int mk_Dynamic(Itdb_iTunesDB *itdb, const char *outpath) if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 2 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 2 sqlite3_step returned %d\n", __func__, res); } } @@ -344,7 +344,7 @@ static int mk_Dynamic(Itdb_iTunesDB *itdb, const char *outpath) } res = 0; - printf("[%s] done.\n", __func__); + itdb_log_debug("[%s] done.\n", __func__); leave: if (db) { sqlite3_close(db); @@ -367,31 +367,31 @@ static int mk_Extras(Itdb_iTunesDB *itdb, const char *outpath) GList *gl = NULL; dbf = g_build_filename(outpath, "Extras.itdb", NULL); - printf("[%s] Processing '%s'\n", __func__, dbf); + itdb_log_debug("[%s] Processing '%s'\n", __func__, dbf); if (stat(dbf, &fst) != 0) { if (errno == ENOENT) { /* file is not present. so we need to create the tables in it ;) */ rebuild = 1; } else { - fprintf(stderr, "[%s] Error: stat: %s\n", __func__, strerror(errno)); + itdb_log_error("[%s] Error: stat: %s\n", __func__, strerror(errno)); goto leave; } } if (SQLITE_OK != sqlite3_open((const char*)dbf, &db)) { - fprintf(stderr, "Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); + itdb_log_error("Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); goto leave; } sqlite3_exec(db, "PRAGMA synchronous = OFF;", NULL, NULL, NULL); if (rebuild) { - fprintf(stderr, "[%s] re-building table structure\n", __func__); + itdb_log_error("[%s] re-building table structure\n", __func__); /* db structure needs to be created. */ if (SQLITE_OK != sqlite3_exec(db, Extras_create, NULL, NULL, &errmsg)) { - fprintf(stderr, "[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); if (errmsg) { - fprintf(stderr, "[%s] additional error information: %s\n", __func__, errmsg); + itdb_log_error("[%s] additional error information: %s\n", __func__, errmsg); sqlite3_free(errmsg); errmsg = NULL; } @@ -401,15 +401,15 @@ static int mk_Extras(Itdb_iTunesDB *itdb, const char *outpath) sqlite3_exec(db, "BEGIN;", NULL, NULL, NULL); if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"chapter\" VALUES(?,?);", -1, &stmt_chapter, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } /* kill all entries in 'chapter' as they will be re-inserted */ if (SQLITE_OK != sqlite3_exec(db, "DELETE FROM chapter;", NULL, NULL, &errmsg)) { - fprintf(stderr, "[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); if (errmsg) { - fprintf(stderr, "[%s] additional error information: %s\n", __func__, errmsg); + itdb_log_error("[%s] additional error information: %s\n", __func__, errmsg); sqlite3_free(errmsg); errmsg = NULL; } @@ -419,7 +419,7 @@ static int mk_Extras(Itdb_iTunesDB *itdb, const char *outpath) /* kill all entries in 'lyrics' as they will be re-inserted */ /* TODO: we do not support this in the moment, so don't touch this */ /*if (SQLITE_OK != sqlite3_exec(db, "DELETE FROM lyrics;", NULL, NULL, &errmsg)) { - fprintf(stderr, "[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); + fprintf("[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); if (errmsg) { fprintf(stderr, "[%s] additional error information: %s\n", __func__, errmsg); sqlite3_free(errmsg); @@ -436,7 +436,7 @@ static int mk_Extras(Itdb_iTunesDB *itdb, const char *outpath) /* printf("[%s] -- inserting into \"chapter\"\n", __func__); */ res = sqlite3_reset(stmt_chapter); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* item_pid INTEGER NOT NULL */ sqlite3_bind_int64(stmt_chapter, ++idx, track->dbid); @@ -447,7 +447,7 @@ static int mk_Extras(Itdb_iTunesDB *itdb, const char *outpath) if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 8 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 8 sqlite3_step returned %d\n", __func__, res); } g_byte_array_free(chapter_blob, TRUE); } @@ -455,7 +455,7 @@ static int mk_Extras(Itdb_iTunesDB *itdb, const char *outpath) sqlite3_exec(db, "COMMIT;", NULL, NULL, NULL); res = 0; - printf("[%s] done.\n", __func__); + itdb_log_debug("[%s] done.\n", __func__); leave: if (stmt_chapter) { sqlite3_finalize(stmt_chapter); @@ -479,31 +479,31 @@ static int mk_Genius(Itdb_iTunesDB *itdb, const char *outpath) struct stat fst; dbf = g_build_filename(outpath, "Genius.itdb", NULL); - printf("[%s] Processing '%s'\n", __func__, dbf); + itdb_log_debug("[%s] Processing '%s'\n", __func__, dbf); if (stat(dbf, &fst) != 0) { if (errno == ENOENT) { /* file is not present. so we need to create the tables in it ;) */ rebuild = 1; } else { - fprintf(stderr, "[%s] Error: stat: %s\n", __func__, strerror(errno)); + itdb_log_error("[%s] Error: stat: %s\n", __func__, strerror(errno)); goto leave; } } if (SQLITE_OK != sqlite3_open((const char*)dbf, &db)) { - fprintf(stderr, "Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); + itdb_log_error("Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); goto leave; } sqlite3_exec(db, "PRAGMA synchronous = OFF;", NULL, NULL, NULL); if (rebuild) { - fprintf(stderr, "[%s] re-building table structure\n", __func__); + itdb_log_error("[%s] re-building table structure\n", __func__); /* db structure needs to be created. */ if (SQLITE_OK != sqlite3_exec(db, Genius_create, NULL, NULL, &errmsg)) { - fprintf(stderr, "[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); if (errmsg) { - fprintf(stderr, "[%s] additional error information: %s\n", __func__, errmsg); + itdb_log_error("[%s] additional error information: %s\n", __func__, errmsg); sqlite3_free(errmsg); errmsg = NULL; } @@ -552,7 +552,7 @@ static int mk_Genius(Itdb_iTunesDB *itdb, const char *outpath) sqlite3_exec(db, "COMMIT;", NULL, NULL, NULL); res = 0; - printf("[%s] done.\n", __func__); + itdb_log_debug("[%s] done.\n", __func__); leave: if (db) { sqlite3_close(db); @@ -615,38 +615,38 @@ static int mk_Library(Itdb_iTunesDB *itdb, GHashTable *genre_map = NULL; GHashTable **orders = NULL; guint32 genre_index; - printf("library_persistent_id = 0x%016"G_GINT64_MODIFIER"x\n", itdb->priv->pid); + itdb_log_debug("library_persistent_id = 0x%016"G_GINT64_MODIFIER"x\n", itdb->priv->pid); dbf = g_build_filename(outpath, "Library.itdb", NULL); - printf("[%s] Processing '%s'\n", __func__, dbf); + itdb_log_debug("[%s] Processing '%s'\n", __func__, dbf); if (stat(dbf, &fst) != 0) { if (errno == ENOENT) { /* file is not present. so we will create it */ } else { - fprintf(stderr, "[%s] Error: stat: %s\n", __func__, strerror(errno)); + itdb_log_error("[%s] Error: stat: %s\n", __func__, strerror(errno)); goto leave; } } else { /* file is present. delete it, we'll re-create it. */ if (unlink(dbf) != 0) { - fprintf(stderr, "[%s] could not delete '%s': %s\n", __func__, dbf, strerror(errno)); + itdb_log_error("[%s] could not delete '%s': %s\n", __func__, dbf, strerror(errno)); goto leave; } } if (SQLITE_OK != sqlite3_open((const char*)dbf, &db)) { - fprintf(stderr, "Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); + itdb_log_error("Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); goto leave; } sqlite3_exec(db, "PRAGMA synchronous = OFF;", NULL, NULL, NULL); - fprintf(stderr, "[%s] building table structure\n", __func__); + itdb_log_error("[%s] building table structure\n", __func__); /* db structure needs to be created. */ if (SQLITE_OK != sqlite3_exec(db, Library_create, NULL, NULL, &errmsg)) { - fprintf(stderr, "[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); if (errmsg) { - fprintf(stderr, "[%s] additional error information: %s\n", __func__, errmsg); + itdb_log_error("[%s] additional error information: %s\n", __func__, errmsg); sqlite3_free(errmsg); errmsg = NULL; } @@ -655,22 +655,22 @@ static int mk_Library(Itdb_iTunesDB *itdb, sqlite3_exec(db, "BEGIN;", NULL, NULL, NULL); - fprintf(stderr, "[%s] compiling SQL statements\n", __func__); + itdb_log_error("[%s] compiling SQL statements\n", __func__); if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"version_info\" VALUES(?,?,?,?,?,?,?);", -1, &stmt_version_info, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"db_info\" VALUES(?,?,?,?,?,?,?,?);", -1, &stmt_db_info, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"container\" " "VALUES(?,?,?,?,:name,?,?,?,?,?,?,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);", -1, &stmt_container, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"genre_map\" (id,genre,genre_order) VALUES(?,?,0);", -1, &stmt_genre_map, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"item\" " @@ -681,39 +681,39 @@ static int mk_Library(Itdb_iTunesDB *itdb, "album_order,genre_order,composer_order,album_artist_order,album_by_artist_order,series_name_order,comment,grouping," "description,description_long) " "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", -1, &stmt_item, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT OR IGNORE INTO \"location_kind_map\" VALUES(?,:kind);", -1, &stmt_location_kind_map, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"avformat_info\" VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?);", -1, &stmt_avformat_info, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"item_to_container\" VALUES(?,?,?,?);", -1, &stmt_item_to_container, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT OR IGNORE INTO \"album\" VALUES(?,?,?,?,?,?,?,?,?,?,?);", -1, &stmt_album, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT OR IGNORE INTO \"artist\" VALUES(?,?,?,?,?,?,?);", -1, &stmt_artist, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT OR IGNORE INTO \"composer\" (pid,name,name_order,sort_name) VALUES(?,?,?,?);", -1, &stmt_composer, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"video_info\" VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", -1, &stmt_video_info, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } - printf("[%s] - inserting into \"version_info\"\n", __func__); + itdb_log_debug("[%s] - inserting into \"version_info\"\n", __func__); /* INSERT INTO "version_info" VALUES(1,2,40,0,0,0,2); */ idx = 0; /* id */ @@ -739,10 +739,10 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 2 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 2 sqlite3_step returned %d\n", __func__, res); } - printf("[%s] - inserting into \"genre_map\"\n", __func__); + itdb_log_debug("[%s] - inserting into \"genre_map\"\n", __func__); genre_map = g_hash_table_new(g_str_hash, g_str_equal); /* build genre_map */ @@ -755,7 +755,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, res = sqlite3_reset(stmt_genre_map); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } idx = 0; @@ -766,7 +766,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, res = sqlite3_step(stmt_genre_map); if (res != SQLITE_DONE) { - fprintf(stderr, "[%s] sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_step returned %d\n", __func__, res); goto leave; } } @@ -783,7 +783,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, dev_playlist = pl; } - printf("[%s] - inserting songs into \"item_to_container\"\n", __func__); + itdb_log_debug("[%s] - inserting songs into \"item_to_container\"\n", __func__); for (glt = pl->members; glt; glt = glt->next) { Itdb_Track *track = glt->data; @@ -791,7 +791,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, /* printf("[%s] -- inserting into \"item_to_container\"\n", __func__); */ res = sqlite3_reset(stmt_item_to_container); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* INSERT INTO "item_to_container" VALUES(-6197982141081478573,959107999841118509,0,NULL); */ idx = 0; /* item_pid */ @@ -808,16 +808,16 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 8 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 8 sqlite3_step returned %d\n", __func__, res); } types |= track->mediatype; } - printf("[%s] - inserting playlist '%s' into \"container\"\n", __func__, pl->name); + itdb_log_debug("[%s] - inserting playlist '%s' into \"container\"\n", __func__, pl->name); res = sqlite3_reset(stmt_container); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* INSERT INTO "container" VALUES(959107999841118509,0,267295295,'Hamouda',400,0,1,0,1,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); */ idx = 0; @@ -862,23 +862,23 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 4 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 4 sqlite3_step returned %d\n", __func__, res); } } if (!dev_playlist) { - fprintf(stderr, "Could not find special device playlist!\n"); + itdb_log_error("Could not find special device playlist!\n"); goto leave; } - printf("library_persistent_id = 0x%016"G_GINT64_MODIFIER"x\n", itdb->priv->pid); + itdb_log_debug("library_persistent_id = 0x%016"G_GINT64_MODIFIER"x\n", itdb->priv->pid); if (!dev_playlist->name) { - fprintf(stderr, "Could not fetch device name from itdb!\n"); + itdb_log_error("Could not fetch device name from itdb!\n"); goto leave; } - printf("device name = %s\n", dev_playlist->name); + itdb_log_debug("device name = %s\n", dev_playlist->name); - printf("[%s] - inserting into \"db_info\"\n", __func__); + itdb_log_debug("[%s] - inserting into \"db_info\"\n", __func__); idx = 0; /* pid */ sqlite3_bind_int64(stmt_db_info, ++idx, itdb->priv->pid); @@ -910,11 +910,11 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 3 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 3 sqlite3_step returned %d\n", __func__, res); } /* for each track: */ - printf("[%s] - processing %d tracks\n", __func__, g_list_length(itdb->tracks)); + itdb_log_debug("[%s] - processing %d tracks\n", __func__, g_list_length(itdb->tracks)); orders = compute_key_orders(itdb->tracks); for (gl = itdb->tracks; gl; gl = gl->next) { @@ -932,7 +932,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, /* printf("[%s] -- inserting into \"item\"\n", __func__); */ res = sqlite3_reset(stmt_item); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* INSERT INTO "item" VALUES(-6197982141081478573,NULL,1,1,0,0,0,0,0,0,0,0,0,0,2004,0,0,0,0,0,0,2,0,0.0,0.0,213812.0,NULL,1,0,0,0,0,0,NULL,NULL,0,0,0,-7670716306765259718,-7576753259813584028,0,'Enjoy the silence 2004 (Reinterpreted by Mike Shinoda)','Depeche Mode','Enjoy The Silence 04 CDS','Depeche Mode',NULL,'Enjoy the silence 2004 (Reinterpreted by Mike Shinoda)','Depeche Mode','Enjoy The Silence 04 CDS','Depeche Mode',NULL,100,100,100,100,100,100,NULL,100,'Lbl MUTE C:MUTE RCDBONG034',NULL,NULL,NULL,1,0,0,0,0,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL); */ idx = 0; @@ -1068,14 +1068,14 @@ static int mk_Library(Itdb_iTunesDB *itdb, res = sqlite3_step(stmt_item); if (res != SQLITE_DONE) { - fprintf(stderr, "[%s] 6 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 6 sqlite3_step returned %d\n", __func__, res); goto leave; } /* printf("[%s] -- inserting into \"location_kind_map\" (if required)\n", __func__); */ res = sqlite3_reset(stmt_location_kind_map); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* INSERT INTO "location_kind_map" VALUES(1,'MPEG-Audiodatei'); */ idx = 0; /* id */ @@ -1087,13 +1087,13 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 5 sqlite3_step returned %d: %s\n", __func__, res, sqlite3_errmsg(db)); + itdb_log_error("[%s] 5 sqlite3_step returned %d: %s\n", __func__, res, sqlite3_errmsg(db)); } /* printf("[%s] -- inserting into \"avformat_info\"\n", __func__); */ res = sqlite3_reset(stmt_avformat_info); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* INSERT INTO "avformat_info" VALUES(-6197982141081478573,0,301,232,44100.0,9425664,1,576,2880,6224207,0,0,0); */ idx = 0; /* item_pid */ @@ -1143,7 +1143,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 7 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 7 sqlite3_step returned %d\n", __func__, res); } /* this is done by a trigger, so we don't need to do this :-D */ @@ -1153,7 +1153,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, /* printf("[%s] -- inserting into \"album\" (if required)\n", __func__); */ res = sqlite3_reset(stmt_album); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* INSERT INTO "album" VALUES(-7670716306765259718,2,0,0,-7576753259813584028,0,'Enjoy The Silence 04 CDS',100,0,NULL,0); */ idx = 0; @@ -1190,7 +1190,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 8 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 8 sqlite3_step returned %d\n", __func__, res); } } @@ -1199,7 +1199,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, /* printf("[%s] -- inserting into \"artist\" (if required)\n", __func__); */ res = sqlite3_reset(stmt_artist); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } /* INSERT INTO "artist" VALUES(-7576753259813584028,2,0,0,'Depeche Mode',100,'Depeche Mode'); */ idx = 0; @@ -1226,7 +1226,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 8 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 8 sqlite3_step returned %d\n", __func__, res); } } @@ -1234,7 +1234,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, /* printf("[%s] -- inserting into \"composer\" (if required)\n", __func__); */ res = sqlite3_reset(stmt_composer); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } idx = 0; /* pid */ @@ -1251,7 +1251,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 8 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 8 sqlite3_step returned %d\n", __func__, res); } } /* if it's a movie, music video or tv show */ @@ -1261,7 +1261,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, /* printf("[%s] -- inserting into \"video_info\"\n", __func__); */ res = sqlite3_reset(stmt_video_info); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] 1 sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] 1 sqlite3_reset returned %d\n", __func__, res); } idx = 0; /* item_pid INTEGER NOT NULL */ @@ -1313,7 +1313,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 8 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 8 sqlite3_step returned %d\n", __func__, res); } } } @@ -1323,7 +1323,7 @@ static int mk_Library(Itdb_iTunesDB *itdb, sqlite3_exec(db, "COMMIT;", NULL, NULL, NULL); res = 0; - printf("[%s] done.\n", __func__); + itdb_log_debug("[%s] done.\n", __func__); leave: if (orders != NULL) { destroy_key_orders(orders); @@ -1387,28 +1387,28 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu int idx = 0; dbf = g_build_filename(outpath, "Locations.itdb", NULL); - printf("[%s] Processing '%s'\n", __func__, dbf); + itdb_log_debug("[%s] Processing '%s'\n", __func__, dbf); /* file is present. delete it, we'll re-create it. */ if (g_unlink(dbf) != 0) { if (errno != ENOENT) { - fprintf(stderr, "[%s] could not delete '%s': %s\n", __func__, dbf, strerror(errno)); + itdb_log_error("[%s] could not delete '%s': %s\n", __func__, dbf, strerror(errno)); goto leave; } } if (SQLITE_OK != sqlite3_open((const char*)dbf, &db)) { - fprintf(stderr, "Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); + itdb_log_error("Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); goto leave; } sqlite3_exec(db, "PRAGMA synchronous = OFF;", NULL, NULL, NULL); - fprintf(stderr, "[%s] re-building table structure\n", __func__); + itdb_log_error("[%s] re-building table structure\n", __func__); /* db structure needs to be created. */ if (SQLITE_OK != sqlite3_exec(db, Locations_create, NULL, NULL, &errmsg)) { - fprintf(stderr, "[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_exec error: %s\n", __func__, sqlite3_errmsg(db)); if (errmsg) { - fprintf(stderr, "[%s] additional error information: %s\n", __func__, errmsg); + itdb_log_error("[%s] additional error information: %s\n", __func__, errmsg); sqlite3_free(errmsg); errmsg = NULL; } @@ -1418,13 +1418,13 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu sqlite3_exec(db, "BEGIN;", NULL, NULL, NULL); if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"base_location\" (id, path) VALUES (?,?);", -1, &stmt, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } idx = 0; res = sqlite3_reset(stmt); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_reset returned %d\n", __func__, res); } sqlite3_bind_int(stmt, ++idx, 1); @@ -1437,14 +1437,14 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_step returned %d\n", __func__, res); } if (itdb_device_is_iphone_family(itdb->device)) { idx = 0; res = sqlite3_reset(stmt); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_reset returned %d\n", __func__, res); } sqlite3_bind_int(stmt, ++idx, 4); sqlite3_bind_text(stmt, ++idx, "Podcasts", -1, SQLITE_STATIC); @@ -1452,13 +1452,13 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_step returned %d\n", __func__, res); } idx = 0; res = sqlite3_reset(stmt); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_reset returned %d\n", __func__, res); } sqlite3_bind_int(stmt, ++idx, 6); sqlite3_bind_text(stmt, ++idx, "iTunes_Control/Ringtones", -1, SQLITE_STATIC); @@ -1466,7 +1466,7 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_step returned %d\n", __func__, res); } } @@ -1475,14 +1475,14 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu } if (SQLITE_OK != sqlite3_prepare_v2(db, "INSERT INTO \"location\" (item_pid, sub_id, base_location_id, location_type, location, extension, kind_id, date_created, file_size) VALUES(?,?,?,?,?,?,?,?,?);", -1, &stmt, NULL)) { - fprintf(stderr, "[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); + itdb_log_error("[%s] sqlite3_prepare error: %s\n", __func__, sqlite3_errmsg(db)); goto leave; } if (itdb->tracks) { GList *gl = NULL; - printf("[%s] Processing %d tracks...\n", __func__, g_list_length(itdb->tracks)); + itdb_log_debug("[%s] Processing %d tracks...\n", __func__, g_list_length(itdb->tracks)); for (gl=itdb->tracks; gl; gl=gl->next) { Itdb_Track *track = gl->data; char *ipod_path; @@ -1498,7 +1498,7 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu idx = 0; res = sqlite3_reset(stmt); if (res != SQLITE_OK) { - fprintf(stderr, "[%s] sqlite3_reset returned %d\n", __func__, res); + itdb_log_error("[%s] sqlite3_reset returned %d\n", __func__, res); } /* item_pid */ sqlite3_bind_int64(stmt, ++idx, track->dbid); @@ -1550,7 +1550,7 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu if (res == SQLITE_DONE) { /* expected result */ } else { - fprintf(stderr, "[%s] 10 sqlite3_step returned %d\n", __func__, res); + itdb_log_error("[%s] 10 sqlite3_step returned %d\n", __func__, res); } if (ipod_path) { free(ipod_path); @@ -1558,13 +1558,13 @@ static int mk_Locations(Itdb_iTunesDB *itdb, const char *outpath, const char *uu } } } else { - printf("[%s] No tracks available, none written.\n", __func__); + itdb_log_debug("[%s] No tracks available, none written.\n", __func__); } sqlite3_exec(db, "COMMIT;", NULL, NULL, NULL); res = 0; - printf("[%s] done.\n", __func__); + itdb_log_debug("[%s] done.\n", __func__); leave: if (stmt) { sqlite3_finalize(stmt); @@ -1637,7 +1637,7 @@ static void sqlite_func_iphone_sort_key(sqlite3_context *context, int argc, sqli int buffer_size = 0; if (argc != 1) - fprintf(stderr, "[%s] Error: Unexpected number of arguments: %d\n", __func__, argc); + itdb_log_error("[%s] Error: Unexpected number of arguments: %d\n", __func__, argc); switch (sqlite3_value_type(argv[0])) { case SQLITE_TEXT: @@ -1736,7 +1736,7 @@ static void sqlite_func_iphone_sort_section(sqlite3_context *context, int argc, int res = 26; if (argc != 1) - fprintf(stderr, "[%s] Error: Unexpected number of arguments: %d\n", __func__, argc); + itdb_log_error("[%s] Error: Unexpected number of arguments: %d\n", __func__, argc); switch (sqlite3_value_type(argv[0])) { case SQLITE_BLOB: @@ -1771,12 +1771,12 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, ret = idevice_new(&phone, uuid); if (ret != IDEVICE_E_SUCCESS) { - printf("[%s] ERROR: Could not find device with uuid %s, is it plugged in?\n", __func__, uuid); + itdb_log_debug("[%s] ERROR: Could not find device with uuid %s, is it plugged in?\n", __func__, uuid); goto leave; } if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "libgpod")) { - printf("[%s] ERROR: Could not connect to device's lockdownd!\n", __func__); + itdb_log_debug("[%s] ERROR: Could not connect to device's lockdownd!\n", __func__); idevice_free(phone); goto leave; } @@ -1826,7 +1826,7 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, plist_t sql_cmds = NULL; plist_t user_ver_cmds = NULL; - printf("[%s] Getting SQL post process commands\n", __func__); + itdb_log_debug("[%s] Getting SQL post process commands\n", __func__); sql_cmds = plist_dict_get_item(ppc_dict, "SQLCommands"); user_ver_cmds = plist_dict_get_item(ppc_dict, "UserVersionCommandSets"); @@ -1884,7 +1884,7 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, g_hash_table_insert(sqlcmd_map, key, val); val = NULL; } else { - printf("[%s] WARNING: ignoring non-string value for key '%s'\n", __func__, key); + itdb_log_debug("[%s] WARNING: ignoring non-string value for key '%s'\n", __func__, key); free(key); } subnode = NULL; @@ -1899,7 +1899,7 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, dbf = g_build_filename(outpath, basedb, NULL); if (SQLITE_OK != sqlite3_open((const char*)dbf, &db)) { - fprintf(stderr, "Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); + itdb_log_error("Error opening database '%s': %s\n", dbf, sqlite3_errmsg(db)); g_free(dbf); goto leave; } @@ -1915,7 +1915,7 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, res = sqlite3_exec(db, attach_str, NULL, NULL, &errmsg); g_free(attach_str); if (res != SQLITE_OK) { - printf("[%s] WARNING: Could not attach database '%s': %s\n", __func__, otherdbs[i], errmsg); + itdb_log_debug("[%s] WARNING: Could not attach database '%s': %s\n", __func__, otherdbs[i], errmsg); } if (errmsg) { free(errmsg); @@ -1923,12 +1923,12 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, i++; } - printf("[%s] binding functions\n", __func__); + itdb_log_debug("[%s] binding functions\n", __func__); sqlite3_create_function(db, "iPhoneSortKey", 1, SQLITE_ANY, NULL, &sqlite_func_iphone_sort_key, NULL, NULL); sqlite3_create_function(db, "iPhoneSortSection", 1, SQLITE_ANY, NULL, &sqlite_func_iphone_sort_section, NULL, NULL); cnt = plist_array_get_size(user_ver_cmds); - printf("[%s] Running %d post process commands now\n", __func__, cnt); + itdb_log_debug("[%s] Running %d post process commands now\n", __func__, cnt); sqlite3_exec(db, "BEGIN;", NULL, NULL, NULL); for (i=0; i<cnt; i++) { @@ -1942,13 +1942,13 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, /*printf("[%s] executing '%s': OK", __func__, key);*/ ok_cnt++; } else { - printf("[%s] ERROR when executing '%s': %s\n", __func__, key, errmsg); + itdb_log_debug("[%s] ERROR when executing '%s': %s\n", __func__, key, errmsg); } if (errmsg) { sqlite3_free(errmsg); } } else { - printf("[%s] value for '%s' not found in hashmap!\n", __func__, key); + itdb_log_debug("[%s] value for '%s' not found in hashmap!\n", __func__, key); } free(key); key = NULL; @@ -1957,24 +1957,24 @@ static void run_post_process_commands(Itdb_iTunesDB *itdb, const char *outpath, g_hash_table_foreach(sqlcmd_map, free_key_val_strings, NULL); g_hash_table_destroy(sqlcmd_map); - printf("[%s] %d out of %d post process commands successfully executed\n", __func__, ok_cnt, cnt); + itdb_log_debug("[%s] %d out of %d post process commands successfully executed\n", __func__, ok_cnt, cnt); /* TODO perhaps we want to roll back when an error has occured ? */ sqlite3_exec(db, "COMMIT;", NULL, NULL, NULL); } else { - printf("[%s]: Error: could not create hash table!\n", __func__); + itdb_log_debug("[%s]: Error: could not create hash table!\n", __func__); } } else { - printf("[%s]: Error fetching commands array\n", __func__); + itdb_log_debug("[%s]: Error fetching commands array\n", __func__); } } else { - printf("[%s]: Error fetching user version command set\n", __func__); + itdb_log_debug("[%s]: Error fetching user version command set\n", __func__); } } else { - printf("[%s]: Error fetching post process commands from device!\n", __func__); + itdb_log_debug("[%s]: Error fetching post process commands from device!\n", __func__); } } - printf("[%s] done.\n", __func__); + itdb_log_debug("[%s] done.\n", __func__); leave: if (db) { @@ -2091,7 +2091,7 @@ static gboolean mk_Locations_cbk(Itdb_iTunesDB *itdb, const char *dirname) break; } if (cbk_header_size == 0) { - fprintf(stderr, "ERROR: Unsupported checksum type '%d' in cbk file generation!\n", checksum_type); + itdb_log_error("ERROR: Unsupported checksum type '%d' in cbk file generation!\n", checksum_type); return FALSE; } @@ -2208,11 +2208,11 @@ static int copy_itdb_file(const gchar *from_dir, const gchar *to_dir, gchar *dstname = g_build_filename(to_dir, fname, NULL); if (itdb_cp(srcname, dstname, error)) { - fprintf(stderr, "itdbprep: copying '%s'\n", fname); + itdb_log_error("itdbprep: copying '%s'\n", fname); res++; } if (error && *error) { - fprintf(stderr, "Error copying '%s' to '%s': %s\n", srcname, dstname, (*error)->message); + itdb_log_error("Error copying '%s' to '%s': %s\n", srcname, dstname, (*error)->message); } if (srcname) { @@ -2257,21 +2257,21 @@ int itdb_sqlite_generate_itdbs(FExport *fexp) gchar *dirname; gchar *tmpdir = NULL; - printf("libitdbprep: %s called with file %s and uuid %s\n", __func__, + itdb_log_debug("libitdbprep: %s called with file %s and uuid %s\n", __func__, fexp->itdb->filename, itdb_device_get_uuid(fexp->itdb->device)); dirname = itdb_get_itunes_dir(itdb_get_mountpoint(fexp->itdb)); itlpdir = g_build_filename(dirname, "iTunes Library.itlp", NULL); g_free(dirname); - printf("itlp directory='%s'\n", itlpdir); + itdb_log_debug("itlp directory='%s'\n", itlpdir); if (... [truncated message content] |
From: Rory Y. <ror...@gm...> - 2014-02-16 06:37:34
|
Hi, This Python script: import gpod db=gpod.Database('/media/rory/IPOD') pc=db.get_podcasts() print '>RORY> gpod version: %s' % gpod.version print '>RORY> FOUND %d podcasts' % len(pc) db.close() produces this output: >RORY> gpod version: 0.8.2 >RORY> FOUND 62 podcasts ** (count_podcasts.py:24009): CRITICAL **: itdb_splr_validate: assertion 'at != ITDB_SPLAT_UNKNOWN' failed libitdbprep: itdb_sqlite_generate_itdbs called with file /media/rory/IPOD/iPod_Control/iTunes/iTunesCDB and uuid 000A2700209D1DD6 itlp directory='/media/rory/IPOD/iPod_Control/iTunes/iTunes Library.itlp' *.itdb files will be stored in '/media/rory/IPOD/iPod_Control/iTunes/iTunes Library.itlp' [mk_Dynamic] Processing '/tmp/fileQyzXqi/Dynamic.itdb' [mk_Dynamic] creating table structure [mk_Dynamic] - processing 1410 tracks [mk_Dynamic] - processing 7 playlists [mk_Dynamic] done. [mk_Extras] Processing '/tmp/fileQyzXqi/Extras.itdb' [mk_Extras] re-building table structure [mk_Extras] done. [mk_Genius] Processing '/tmp/fileQyzXqi/Genius.itdb' [mk_Genius] re-building table structure [mk_Genius] done. library_persistent_id = 0xace01813e3ec0b44 [mk_Library] Processing '/tmp/fileQyzXqi/Library.itdb' [mk_Library] building table structure [mk_Library] compiling SQL statements [mk_Library] - inserting into "version_info" [mk_Library] - inserting into "genre_map" [mk_Library] - inserting songs into "item_to_container" [mk_Library] - inserting playlist 'IPOD' into "container" [mk_Library] - inserting songs into "item_to_container" [mk_Library] - inserting playlist 'Podcasts' into "container" [mk_Library] - inserting songs into "item_to_container" [mk_Library] - inserting playlist 'rutabaga' into "container" [mk_Library] - inserting songs into "item_to_container" [mk_Library] - inserting playlist 'myvids' into "container" [mk_Library] - inserting songs into "item_to_container" [mk_Library] - inserting playlist 'kale' into "container" [mk_Library] - inserting songs into "item_to_container" [mk_Library] - inserting playlist 'New playlist' into "container" [mk_Library] - inserting songs into "item_to_container" [mk_Library] - inserting playlist '2013-07-21' into "container" library_persistent_id = 0xace01813e3ec0b44 device name = IPOD [mk_Library] - inserting into "db_info" [mk_Library] - processing 1410 tracks [mk_Library] done. [mk_Locations] Processing '/tmp/fileQyzXqi/Locations.itdb' [mk_Locations] re-building table structure [mk_Locations] Processing 1410 tracks... [mk_Locations] done. [run_post_process_commands] Getting SQL post process commands [run_post_process_commands] binding functions [run_post_process_commands] Running 88 post process commands now [run_post_process_commands] ERROR when executing 'CreateRentalExpiredColumn': duplicate column name: rental_expired [run_post_process_commands] 87 out of 88 post process commands successfully executed [run_post_process_commands] done. itdbprep: copying 'Dynamic.itdb' itdbprep: copying 'Extras.itdb' itdbprep: copying 'Genius.itdb' itdbprep: copying 'Library.itdb' itdbprep: copying 'Locations.itdb' itdbprep: copying 'Locations.itdb.cbk' (version is 0.8.2 because that's running against the default Ubuntu 13.10 version.) libgpod's output is a little verbose, and there isn't an obvious way to keep it quiet ("2>/dev/null" isn't a great option). So, I've changed all the printf and fprintf calls in src/*.c so that the default is to print nothing: rory@rory-Inspiron-3521:~/hack/gpod$ python count_podcasts.py >RORY> gpod version: 0.8.3 >RORY> FOUND 62 podcasts ** (process:24018): CRITICAL **: itdb_splr_validate: assertion 'at != ITDB_SPLAT_UNKNOWN' failed (this, incidentally, highlights the assertion failure which was rather buried in the noise). One can print error messages by setting ITDB_LOGLEVEL, so for example: rory@rory-Inspiron-3521:~/hack/gpod$ ITDB_LOGLEVEL=1 python count_podcasts.py >RORY> gpod version: 0.8.3 >RORY> FOUND 62 podcasts ** (process:24017): CRITICAL **: itdb_splr_validate: assertion 'at != ITDB_SPLAT_UNKNOWN' failed [mk_Dynamic] creating table structure [mk_Extras] re-building table structure [mk_Genius] re-building table structure [mk_Library] building table structure [mk_Library] compiling SQL statements [mk_Locations] re-building table structure itdbprep: copying 'Dynamic.itdb' itdbprep: copying 'Extras.itdb' itdbprep: copying 'Genius.itdb' itdbprep: copying 'Library.itdb' itdbprep: copying 'Locations.itdb' itdbprep: copying 'Locations.itdb.cbk' ITDB_LOGLEVEL=2 produces the original output. Alternatives to this are to use a logging library, such as log4c or zlog, or, for error messages, to store the error string, report an error condition, and use something similar to the standard library's strerror() to allow the caller to retrieve a detailed error message. This could be useful for GUI messages and constructing Python exceptions. Possible improvements to this patch set: - decide on loglevel once, rather than calling setenv(), strtol(), etc., every call - make the functions internal (G_GNUC_INTERNAL - I forgot about this) Review and comments welcome. Regards, Rory |
From: phantomjinx <p.g...@ph...> - 2013-12-21 18:55:17
|
Massimiliano Ferrari <max...@gm...> wrote: >Excuse for my english, i am italian and i have a problem when build the >gtkpod >I have a error when comand make. >The error is : >"make all-recursive >make[1]: ingresso nella directory "/home/aragorn/code" >Making all in libgtkpod >make[2]: ingresso nella directory "/home/aragorn/code/libgtkpod" > CC gtkpod_app_iface.lo >gtkpod_app_iface.c: In function 'ok_to_close_gtkpod': >gtkpod_app_iface.c:152:104: error: 'GTK_STOCK_SAVE' undeclared (first >use >in this function) > = gtkpod_confirmation_hig(GTK_MESSAGE_WARNING, _("Save >changes before quiting?"), str, GTK_STOCK_SAVE, GTK_STOCK_CANCEL, >_("Quit >without saving"), NULL); > > ^ >gtkpod_app_iface.c:152:104: note: each undeclared identifier is >reported >only once for each function it appears in >gtkpod_app_iface.c:152:120: error: 'GTK_STOCK_CANCEL' undeclared (first >use >in this function) > = gtkpod_confirmation_hig(GTK_MESSAGE_WARNING, _("Save >changes before quiting?"), str, GTK_STOCK_SAVE, GTK_STOCK_CANCEL, >_("Quit >without saving"), NULL); > > ^ >gtkpod_app_iface.c: In function 'gtkpod_display_command_ctx_menu': >gtkpod_app_iface.c:611:61: error: 'GTK_STOCK_EXECUTE' undeclared (first >use >in this function) > hookup_menu_item(menu, track_command_get_text(cmd), >GTK_STOCK_EXECUTE, G_CALLBACK (on_track_command_menuitem_activate), >pairarr); > ^ >Makefile:607: set di istruzioni per l'obiettivo "gtkpod_app_iface.lo" >non >riuscito >make[2]: *** [gtkpod_app_iface.lo] Errore 1 >make[2]: uscita dalla directory "/home/aragorn/code/libgtkpod" >Makefile:585: set di istruzioni per l'obiettivo "all-recursive" non >riuscito >make[1]: *** [all-recursive] Errore 1 >make[1]: uscita dalla directory "/home/aragorn/code" >Makefile:472: set di istruzioni per l'obiettivo "all" non riuscito >make: *** [all] Errore 2" > >Thank yuo for your reply >Ferrari Massimiliano > > >------------------------------------------------------------------------ > >------------------------------------------------------------------------------ >Rapidly troubleshoot problems before they affect your business. Most IT > >organizations don't have a clear picture of how application performance > >affects their revenue. With AppDynamics, you get 100% visibility into >your >Java,.NET, & PHP application. Start your 15-day FREE TRIAL of >AppDynamics Pro! >http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > >------------------------------------------------------------------------ > >_______________________________________________ >Gtkpod-devel mailing list >Gtk...@li... >https://lists.sourceforge.net/lists/listinfo/gtkpod-devel Looks like some deprecated symbols have been removed in your os' version of gtk. What os and version are you running? PGR |
From: Massimiliano F. <max...@gm...> - 2013-12-21 16:02:37
|
Excuse for my english, i am italian and i have a problem when build the gtkpod I have a error when comand make. The error is : "make all-recursive make[1]: ingresso nella directory "/home/aragorn/code" Making all in libgtkpod make[2]: ingresso nella directory "/home/aragorn/code/libgtkpod" CC gtkpod_app_iface.lo gtkpod_app_iface.c: In function 'ok_to_close_gtkpod': gtkpod_app_iface.c:152:104: error: 'GTK_STOCK_SAVE' undeclared (first use in this function) = gtkpod_confirmation_hig(GTK_MESSAGE_WARNING, _("Save changes before quiting?"), str, GTK_STOCK_SAVE, GTK_STOCK_CANCEL, _("Quit without saving"), NULL); ^ gtkpod_app_iface.c:152:104: note: each undeclared identifier is reported only once for each function it appears in gtkpod_app_iface.c:152:120: error: 'GTK_STOCK_CANCEL' undeclared (first use in this function) = gtkpod_confirmation_hig(GTK_MESSAGE_WARNING, _("Save changes before quiting?"), str, GTK_STOCK_SAVE, GTK_STOCK_CANCEL, _("Quit without saving"), NULL); ^ gtkpod_app_iface.c: In function 'gtkpod_display_command_ctx_menu': gtkpod_app_iface.c:611:61: error: 'GTK_STOCK_EXECUTE' undeclared (first use in this function) hookup_menu_item(menu, track_command_get_text(cmd), GTK_STOCK_EXECUTE, G_CALLBACK (on_track_command_menuitem_activate), pairarr); ^ Makefile:607: set di istruzioni per l'obiettivo "gtkpod_app_iface.lo" non riuscito make[2]: *** [gtkpod_app_iface.lo] Errore 1 make[2]: uscita dalla directory "/home/aragorn/code/libgtkpod" Makefile:585: set di istruzioni per l'obiettivo "all-recursive" non riuscito make[1]: *** [all-recursive] Errore 1 make[1]: uscita dalla directory "/home/aragorn/code" Makefile:472: set di istruzioni per l'obiettivo "all" non riuscito make: *** [all] Errore 2" Thank yuo for your reply Ferrari Massimiliano |
From: Andrés G. A. <kn...@gm...> - 2013-12-21 00:20:11
|
On 21/11/13 06:00, Scott Wood wrote: > For quite a while now, gtkpod has crashed when trying to add files to my > iPod (80GB video). I finally made time to debug it (using the latest git > trees), and traced it to a NULL pointer dereference in write_rths(). path > was NULL, due to track->ipod_path being NULL. This was due to one of the > tracks being duplicated, with the duplicate entry having no MHOD_ID_PATH. > > Is there any known bug in libgpod (current or former versions) that would > explain the database getting into this state? I hacked up the code enough > to be able to delete the bad file and continue, but is there anything that > could be done to make libgpod handle such corruption more gracefully? > > -Scott FWIW I implemented removal of tracks with null paths in Banshee, so you wouldn't have had this problem if you used this other player. |
From: Scott W. <sc...@bu...> - 2013-11-21 05:48:25
|
For quite a while now, gtkpod has crashed when trying to add files to my iPod (80GB video). I finally made time to debug it (using the latest git trees), and traced it to a NULL pointer dereference in write_rths(). path was NULL, due to track->ipod_path being NULL. This was due to one of the tracks being duplicated, with the duplicate entry having no MHOD_ID_PATH. Is there any known bug in libgpod (current or former versions) that would explain the database getting into this state? I hacked up the code enough to be able to delete the bad file and continue, but is there anything that could be done to make libgpod handle such corruption more gracefully? -Scott |
From: phantomjinx <p.g...@ph...> - 2013-10-29 11:13:23
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10/29/2013 09:32 AM, "Andrés G. Aragoneses" wrote: > On 29/10/13 09:02, tin...@gm... wrote: >>> BTW, if libgpod doesn't support devices from version X of iOS, shouldn't libgpod emit an >>> error (fail fast), so the consumers of the library (media players) can tell the user about >>> it, instead of fail miserably and make the user think that the media player is buggy? >> >> Yes, I also stumbled over this. The music was copied to the device but it just wasted space, >> since the iTunesDB was not properly written. > > Great, are you a libgpod dev? I'm willing to look at this specific bug, so if someone could > give me some pointer to start diving on the code? First question is: is there a reliable way to > know the iOS version that a device is running? > You'll probably want to clone the git repository at have a look at https://sourceforge.net/p/gtkpod/libgpod/ci/master/tree/src/itdb_device.c * itdb_device_get_checksum_type (1907), * called by itdb_device_write_checksum (1985) The fact that the checksum returned is ITDB_CHECKSUM_UNKNOWN could be a useful guide for error handling as well as the writing of the checksum returning false. Regards PGR - -- Paul Richardson * p.g...@ph... * p.g...@re... * pgr...@li... "I know exactly who reads the papers ... * The Daily Mirror is read by people who think they run the country. * The Guardian is read by people who think they ought to run the country. * The Times is read by people who do actually run the country. * The Daily Mail is read by the wives of the people who run the country. * The Financial Times is read by the people who own the country. * The Morning Star is read by the people who think the country ought to be run by another country. * The Daily Telegraph is read by the people who think it is." Jim Hacker, Yes Minister -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJvlSoACgkQcthLMIwdEb1XBwCg8ybuvhp1oKbij2ZbBEJlyyHH 710AmwT4G+9g++2I2zVpg7AakOqaVI6q =DRvR -----END PGP SIGNATURE----- |
From: <tin...@gm...> - 2013-10-29 08:02:37
|
On Mon, Oct 28, 2013 at 15:28:20 +0100, "Andrés G. Aragoneses" wrote: [...] > I completely understand. Then, what do we need for libgpod to overcome > these problems? Does Tor support hosting git repositories? Maybe this sounds sad, but just using a Windows VM with iTunes became even snappier since spicy (a spice client to connect to KVM VMs) supports USB redirection though the network and the VM doesn't even need to run on the computer you are connecting the iDevice to. > BTW, if libgpod doesn't support devices from version X of iOS, shouldn't > libgpod emit an error (fail fast), so the consumers of the > library (media players) can tell the user about it, instead of fail > miserably and make the user think that the media player is buggy? Yes, I also stumbled over this. The music was copied to the device but it just wasted space, since the iTunesDB was not properly written. Regards, Tino |