Eat all bus messages from 'queue2'
@@ -1202,9 +1202,14 @@ kms_player_endpoint_post_media_error (gpointer d)
{
ErrorData *data = d;
- gst_element_post_message (GST_ELEMENT (data->self),
+ gboolean ok = gst_element_post_message (GST_ELEMENT (data->self),
gst_message_ref (data->message));
+ if (!ok) {
+ GST_ERROR ("gst_element_post_message() FAILED");
+ gst_message_unref (data->message);
+ }
+
return G_SOURCE_REMOVE;
}
@@ -1278,6 +1283,12 @@ element_added (GstBin * bin, GstElement * element, gpointer data)
}
}
+static gboolean
+process_bus_message (GstBus * bus, GstMessage * message, gpointer data)
+{
+ return TRUE;
+}
+
static void
kms_player_endpoint_init (KmsPlayerEndpoint * self)
{
@@ -1308,6 +1319,10 @@ kms_player_endpoint_init (KmsPlayerEndpoint * self)
g_signal_connect (self->priv->uridecodebin, "element-added",
G_CALLBACK (element_added), self);
+ /* Eat all async messages such as buffering messages */
+ bus = gst_pipeline_get_bus (GST_PIPELINE (self->priv->pipeline));
+ gst_bus_add_watch (bus, process_bus_message, NULL);
+
g_object_set (self->priv->uridecodebin, "download", TRUE, NULL);
gst_bin_add (GST_BIN (self->priv->pipeline), self->priv->uridecodebin);
