openbsd-ports/devel/libmtp/patches/patch-examples_albumart_c
jasper 8756029f01 - update libmtp to 1.0.3
from LEVAI Daniel, with some tweaks by me
ok william@ (MAINTAINER)
2010-12-21 18:16:04 +00:00

41 lines
1.3 KiB
Plaintext

$OpenBSD: patch-examples_albumart_c,v 1.2 2010/12/21 18:16:04 jasper Exp $
Fix compilation with GCC2.
--- examples/albumart.c.orig Wed Oct 7 01:14:54 2009
+++ examples/albumart.c Tue Dec 21 13:57:21 2010
@@ -43,8 +43,11 @@ int main (int argc, char **argv) {
extern int optind;
extern char *optarg;
LIBMTP_mtpdevice_t *device = NULL;
+ LIBMTP_filesampledata_t *albumart = NULL;
+ LIBMTP_album_t *album = NULL;
int idcount = 0;
int fd;
+ int ret;
uint32_t *ids = NULL;
uint32_t *tmp = NULL;
uint64_t filesize;
@@ -135,18 +138,18 @@ int main (int argc, char **argv) {
return 0;
}
- LIBMTP_filesampledata_t *albumart = LIBMTP_new_filesampledata_t();
+ albumart = LIBMTP_new_filesampledata_t();
albumart->data = imagedata;
albumart->size = filesize;
albumart->filetype = LIBMTP_FILETYPE_JPEG;
- LIBMTP_album_t *album = LIBMTP_new_album_t();
+ album = LIBMTP_new_album_t();
album->name = albumname;
album->no_tracks = idcount;
album->tracks = ids;
album->parent_id = parentid;
album->storage_id = storageid;
- int ret = LIBMTP_Create_New_Album(device,album);
+ ret = LIBMTP_Create_New_Album(device,album);
if (ret == 0) {
ret = LIBMTP_Send_Representative_Sample(device,album->album_id, albumart);
if (ret != 0) {