[libdmapsharing] Clean up some compiler warnings and GStreamer 1.0-related code



commit 7591cc26b8ca64700a09cf21b73a6f2f44bd495d
Author: W. Michael Petullo <mike flyn org>
Date:   Tue Dec 4 10:32:00 2012 -0600

    Clean up some compiler warnings and GStreamer 1.0-related code
    
    Signed-off-by: W. Michael Petullo <mike flyn org>

 libdmapsharing/daap-connection.c       |    2 +-
 libdmapsharing/daap-share.c            |    2 +-
 libdmapsharing/dmap-connection.c       |   23 ++++++++++-------------
 libdmapsharing/dmap-gst-input-stream.c |   17 +++++++++++------
 libdmapsharing/dmap-structure.c        |    4 ++--
 libdmapsharing/dpap-share.c            |    2 +-
 6 files changed, 26 insertions(+), 24 deletions(-)
---
diff --git a/libdmapsharing/daap-connection.c b/libdmapsharing/daap-connection.c
index a2e52c8..d2c8b2f 100644
--- a/libdmapsharing/daap-connection.c
+++ b/libdmapsharing/daap-connection.c
@@ -101,7 +101,7 @@ handle_mlcl (DMAPConnection * connection, DMAPRecordFactory * factory,
 			year = g_value_get_int (&(meta_item->content));
 			break;
 		case DMAP_CC_AEHV:
-			has_video = g_value_get_char (&(meta_item->content));
+			has_video = g_value_get_schar (&(meta_item->content));
 			break;
 		case DMAP_CC_ASSZ:
 			size = g_value_get_int (&(meta_item->content));
diff --git a/libdmapsharing/daap-share.c b/libdmapsharing/daap-share.c
index 7b82166..d676afa 100644
--- a/libdmapsharing/daap-share.c
+++ b/libdmapsharing/daap-share.c
@@ -880,7 +880,7 @@ databases_items_xxx (DMAPShare * share,
 				     "bytes");
 
 	range_header =
-		soup_message_headers_get (msg->request_headers, "Range");
+		soup_message_headers_get_one (msg->request_headers, "Range");
 	if (range_header) {
 		const gchar *s;
 		gchar *content_range;
diff --git a/libdmapsharing/dmap-connection.c b/libdmapsharing/dmap-connection.c
index 37909f3..fbc635c 100644
--- a/libdmapsharing/dmap-connection.c
+++ b/libdmapsharing/dmap-connection.c
@@ -452,13 +452,13 @@ actual_http_response_handler (DAAPResponseData * data)
 		const char *server;
 
 		encoding_header =
-			soup_message_headers_get (data->
-						  message->response_headers,
-						  "Content-Encoding");
+			soup_message_headers_get_one (data->
+						      message->response_headers,
+						     "Content-Encoding");
 
-		server = soup_message_headers_get (data->
-						   message->response_headers,
-						   "DAAP-Server");
+		server = soup_message_headers_get_one (data->
+						       message->response_headers,
+						      "DAAP-Server");
 		if (server != NULL
 		    && strstr (server, ITUNES_7_SERVER) != NULL) {
 			g_debug ("giving up.  we can't talk to %s", server);
@@ -639,13 +639,10 @@ http_response_handler (SoupSession * session,
 	/* to avoid blocking the UI, handle big responses in a separate thread */
 	if (SOUP_STATUS_IS_SUCCESSFUL (data->status)
 	    && data->connection->priv->use_response_handler_thread) {
-		GError *error = NULL;
-
 		g_debug ("creating thread to handle daap response");
-		g_thread_create ((GThreadFunc) actual_http_response_handler,
-				 data, FALSE, &error);
-		if (error) {
-			g_warning ("fuck");
+		GThread *thread = g_thread_new (NULL, (GThreadFunc) actual_http_response_handler, data);
+		if (NULL == thread) {
+			g_warning ("failed to create new thread");
 		}
 	} else {
 		actual_http_response_handler (data);
@@ -1220,7 +1217,7 @@ dmap_connection_setup (DMAPConnection * connection)
 {
 	connection->priv->session = soup_session_async_new ();
 
-	g_signal_connect (connection->priv->session, "authenticate", authenticate_cb, connection);
+	g_signal_connect (connection->priv->session, "authenticate", G_CALLBACK(authenticate_cb), connection);
 
 	connection->priv->base_uri = soup_uri_new (NULL);
 	soup_uri_set_scheme (connection->priv->base_uri,
diff --git a/libdmapsharing/dmap-gst-input-stream.c b/libdmapsharing/dmap-gst-input-stream.c
index 5ebbc0a..793d150 100644
--- a/libdmapsharing/dmap-gst-input-stream.c
+++ b/libdmapsharing/dmap-gst-input-stream.c
@@ -174,9 +174,9 @@ dmap_gst_input_stream_new_buffer_cb (GstElement * element,
 	gsize i;
 	guint8 *ptr;
 	GTimeVal time;
-	GstSample *sample;
-	GstBuffer *buffer;
-	GstMemory *memory;
+	GstSample *sample = NULL;
+	GstBuffer *buffer = NULL;
+	GstMemory *memory = NULL;
 	GstMapInfo info;
 
 	/* FIXME: Is this necessary? I am trying to protect against this
@@ -244,9 +244,6 @@ dmap_gst_input_stream_new_buffer_cb (GstElement * element,
 		}
 	}
 
-	gst_buffer_unref (buffer);
-	gst_memory_unmap (memory, &info);
-
 	if (g_queue_get_length (stream->priv->buffer)
 	    >= stream->priv->read_request) {
 		stream->priv->read_request = 0;
@@ -254,6 +251,14 @@ dmap_gst_input_stream_new_buffer_cb (GstElement * element,
 	}
 
       _return:
+	if (NULL != memory) {
+		gst_memory_unmap (memory, &info);
+	}
+
+	if (NULL != sample) {
+		gst_sample_unref (sample);
+	}
+
 	g_mutex_unlock (stream->priv->buffer_mutex);
 }
 
diff --git a/libdmapsharing/dmap-structure.c b/libdmapsharing/dmap-structure.c
index cf3f67a..d531742 100644
--- a/libdmapsharing/dmap-structure.c
+++ b/libdmapsharing/dmap-structure.c
@@ -412,7 +412,7 @@ dmap_structure_node_serialize (GNode * node, GByteArray * array)
 	switch (dmap_type) {
 	case DMAP_TYPE_BYTE:
 	case DMAP_TYPE_SIGNED_INT:{
-			gchar c = g_value_get_char (&(item->content));
+			gchar c = g_value_get_schar (&(item->content));
 
 			g_byte_array_append (array, (const guint8 *) &c, 1);
 
@@ -598,7 +598,7 @@ dmap_structure_parse_container_buffer (GNode * parent,
 				}
 
 				item->size = 1;
-				g_value_set_char (&(item->content), c);
+				g_value_set_schar (&(item->content), c);
 				break;
 			}
 		case DMAP_TYPE_SHORT:{
diff --git a/libdmapsharing/dpap-share.c b/libdmapsharing/dpap-share.c
index 6c21d68..8ba19a3 100644
--- a/libdmapsharing/dpap-share.c
+++ b/libdmapsharing/dpap-share.c
@@ -476,7 +476,7 @@ add_entry_to_mlcl (gpointer id, DMAPRecord * record, gpointer _mb)
 			g_object_get (record, "location", &location, NULL);
 			if (mapped_file) {
 				/* Free any previously mapped image */
-				g_mapped_file_free (mapped_file);
+				g_mapped_file_unref (mapped_file);
 				mapped_file = NULL;
 			}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]