diff --git a/pinos/client/stream.c b/pinos/client/stream.c index 05bee5169..6b7f6b5c1 100644 --- a/pinos/client/stream.c +++ b/pinos/client/stream.c @@ -858,13 +858,15 @@ on_socket_condition (GSocket *socket, } priv->buffer.size = need; - /* read data */ - len = g_socket_receive (socket, - (gchar *)priv->buffer.data + sizeof (PinosStackHeader), - hdr->length, - NULL, - &error); - g_assert (len == hdr->length); + if (hdr->length > 0) { + /* read data */ + len = g_socket_receive (socket, + (gchar *)priv->buffer.data + sizeof (PinosStackHeader), + hdr->length, + NULL, + &error); + g_assert (len == hdr->length); + } /* handle control messages */ for (i = 0; i < num_messages; i++) { diff --git a/pinos/gst/gstpinospay.c b/pinos/gst/gstpinospay.c index 41388fbb3..d58a6c7bf 100644 --- a/pinos/gst/gstpinospay.c +++ b/pinos/gst/gstpinospay.c @@ -375,10 +375,12 @@ gst_pinos_pay_chain_pinos (GstPinosPay *pay, GstBuffer * buffer) gst_buffer_unmap (buffer, &info); pinos_buffer_clear (&pbuf); - gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (buffer), - fdids_quark, fdids, NULL); - gst_mini_object_weak_ref (GST_MINI_OBJECT_CAST (buffer), - (GstMiniObjectNotify) release_fds, pay); + if (fdids->len > 0) { + gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (buffer), + fdids_quark, fdids, NULL); + gst_mini_object_weak_ref (GST_MINI_OBJECT_CAST (buffer), + (GstMiniObjectNotify) release_fds, pay); + } return gst_pad_push (pay->srcpad, buffer); }