[libdmapsharing] Fix more thumbnail-related code
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing] Fix more thumbnail-related code
- Date: Wed, 15 Nov 2017 07:26:33 +0000 (UTC)
commit 74b9c5f21254ea46fba3d98e9b43f371b779e1e2
Author: W. Michael Petullo <mike flyn org>
Date: Wed Nov 15 02:26:21 2017 -0500
Fix more thumbnail-related code
Signed-off-by: W. Michael Petullo <mike flyn org>
libdmapsharing/dpap-connection.c | 10 +++++-----
libdmapsharing/dpap-share.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/libdmapsharing/dpap-connection.c b/libdmapsharing/dpap-connection.c
index 8382fea..35e0f06 100644
--- a/libdmapsharing/dpap-connection.c
+++ b/libdmapsharing/dpap-connection.c
@@ -53,7 +53,7 @@ handle_mlcl (DMAPConnection * connection, DMAPRecordFactory * factory,
const gchar *format = NULL;
const gchar *comments = NULL;
const gchar *thumbnail = NULL;
- GByteArray *ptr = NULL;
+ GArray *ptr = NULL;
gint creation_date = 0;
gint filesize = 0;
gint large_filesize = 0;
@@ -118,10 +118,10 @@ handle_mlcl (DMAPConnection * connection, DMAPRecordFactory * factory,
}
if (filesize) {
- ptr = g_byte_array_sized_new (filesize);
- g_byte_array_append (ptr, (guint8 *) thumbnail, filesize);
+ ptr = g_array_sized_new (FALSE, FALSE, 1, filesize);
+ g_array_append_vals (ptr, (guint8 *) thumbnail, filesize);
} else {
- ptr = g_byte_array_sized_new (0);
+ ptr = g_array_sized_new (FALSE, FALSE, 1, 0);
}
g_object_set (record,
@@ -136,7 +136,7 @@ handle_mlcl (DMAPConnection * connection, DMAPRecordFactory * factory,
"comments", comments, "thumbnail", ptr, NULL);
if (ptr) {
- g_byte_array_unref (ptr);
+ g_array_unref (ptr);
}
_return:
diff --git a/libdmapsharing/dpap-share.c b/libdmapsharing/dpap-share.c
index 0c05224..5d970ec 100644
--- a/libdmapsharing/dpap-share.c
+++ b/libdmapsharing/dpap-share.c
@@ -412,7 +412,7 @@ add_entry_to_mlcl (guint id, DMAPRecord * record, gpointer _mb)
g_debug ("Format requested but not available");
}
if (_dmap_share_client_requested (mb->bits, PHOTO_IMAGEFILESIZE)) {
- GByteArray *thumbnail = NULL;
+ GArray *thumbnail = NULL;
g_object_get (record, "thumbnail", &thumbnail, NULL);
dmap_structure_add (mlit, DMAP_CC_PIFS,
@@ -456,7 +456,7 @@ add_entry_to_mlcl (guint id, DMAPRecord * record, gpointer _mb)
if (_dmap_share_client_requested (mb->bits, PHOTO_FILEDATA)) {
size_t size = 0;
unsigned char *data = NULL;
- GByteArray *thumbnail = NULL;
+ GArray *thumbnail = NULL;
if (_dmap_share_client_requested (mb->bits, PHOTO_THUMB)) {
g_object_get (record, "thumbnail", &thumbnail, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]