For the last four days I’ve been trying to implement cover art support for iPods in Amarok 2.1. I’ve reached desperate measures here, appealing to the wider public for any hints that might be available.
Here’s the problem. Any returned GdkPixbuf objects from libgpod when called from within Amarok are invalid — they’re either garbled junk, null, glib asserts, or libgpod throws an assertion claiming something or other:
(process:26875): GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion `src != NULL' failed
(process:26875): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)’ failed
(process:16782): CRITICAL **: unpack_UYVY: assertion `width height 2 == bytes_len' failed
The most bizarre part of it is that the exact same code works perfectly when called from within one of libgpod’s unit tests, and artwork retrieval works fine in gtkpod.
A few things I know for sure:
- There is only one version of libgpod installed (0.7.0), self compiled with gdkpixbuf support
- Gtkpod was also self compiled against libgpod 0.7.0
- The libgpod guys have been very involved but can’t provide any answers
- Both gtkpod and Amarok link to the same versions of libgpod and gdk:
$> ldd /usr/lib/kde4/libamarok_collection-ipodcollection.so
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0
libgpod.so.4 => /usr/lib/libgpod.so.4
$> ldd `which gtkpod`
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0
libgpod.so.4 => /usr/lib/libgpod.so.4
- Could it be a race condition somewhere? Perhaps, but as I see it, the code is only ever called from the Qt GUI thread.
Here’s the snippet of code: http://pastie.org/415144
Can anyone provide any insight to this problem? I’m going bananas trying to solve it.