From 284a8c25e7e5fa3daa2207ec954dc7d3c1fac412 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 17 Nov 2003 01:09:56 +0000 Subject: [PATCH] keep pads active at all times (this is a workaround to not get '... but pad is not active' errors Original commit message from CVS: keep pads active at all times (this is a workaround to not get '... but pad is not active' errors --- gst/gstqueue.c | 6 ++++++ plugins/elements/gstqueue.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gst/gstqueue.c b/gst/gstqueue.c index 5c22dc01de..61d5beb1d7 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -223,6 +223,7 @@ gst_queue_init (GTypeInstance *instance, gpointer g_class) gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_get_bufferpool)); gst_pad_set_link_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); + gst_pad_set_active (queue->sinkpad, TRUE); queue->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_pad_set_get_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_get)); @@ -230,6 +231,7 @@ gst_queue_init (GTypeInstance *instance, gpointer g_class) gst_pad_set_link_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); gst_pad_set_event_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_handle_src_event)); + gst_pad_set_active (queue->srcpad, TRUE); queue->leaky = GST_QUEUE_NO_LEAK; queue->queue = NULL; @@ -695,6 +697,10 @@ gst_queue_change_state (GstElement *element) } ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + /* this is an ugly hack to make sure our pads are always active. Reason for this is that + * pad activation for the queue element depends on 2 schedulers (ugh) */ + gst_pad_set_active (queue->sinkpad, TRUE); + gst_pad_set_active (queue->srcpad, TRUE); error: g_mutex_unlock (queue->qlock); diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 5c22dc01de..61d5beb1d7 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -223,6 +223,7 @@ gst_queue_init (GTypeInstance *instance, gpointer g_class) gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_get_bufferpool)); gst_pad_set_link_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); + gst_pad_set_active (queue->sinkpad, TRUE); queue->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_pad_set_get_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_get)); @@ -230,6 +231,7 @@ gst_queue_init (GTypeInstance *instance, gpointer g_class) gst_pad_set_link_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_link)); gst_pad_set_getcaps_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps)); gst_pad_set_event_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_handle_src_event)); + gst_pad_set_active (queue->srcpad, TRUE); queue->leaky = GST_QUEUE_NO_LEAK; queue->queue = NULL; @@ -695,6 +697,10 @@ gst_queue_change_state (GstElement *element) } ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + /* this is an ugly hack to make sure our pads are always active. Reason for this is that + * pad activation for the queue element depends on 2 schedulers (ugh) */ + gst_pad_set_active (queue->sinkpad, TRUE); + gst_pad_set_active (queue->srcpad, TRUE); error: g_mutex_unlock (queue->qlock);