From 148057fa1068094f0237da267d70be68e7af3c23 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 30 May 2005 15:34:13 +0000 Subject: [PATCH] gst/gstqueue.c: Remove old pieces of code Original commit message from CVS: * gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop), (gst_queue_handle_src_event): Remove old pieces of code Flushing the queue in an upstream event is a very bad idea. --- ChangeLog | 7 +++++++ gst/gstqueue.c | 38 +------------------------------------- plugins/elements/gstqueue.c | 38 +------------------------------------- 3 files changed, 9 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61b678c..2383c1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-05-30 Wim Taymans + + * gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain), + (gst_queue_loop), (gst_queue_handle_src_event): + Remove old pieces of code + Flushing the queue in an upstream event is a very bad idea. + 2005-05-26 Andy Wingo * gst/gstminiobject.c (gst_value_mini_object_collect): Use diff --git a/gst/gstqueue.c b/gst/gstqueue.c index 5fe3fb1..299f357 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -632,10 +632,7 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer) g_cond_wait (queue->item_del, queue->qlock); if (queue->flushing) -#if 0 - if (GST_RPAD_IS_FLUSHING (pad)) -#endif - goto out_flushing; + goto out_flushing; /* if there's a pending state change for this queue * or its manager, switch back to iterator so bottom @@ -650,11 +647,6 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer) break; } } -#if 0 - /* we are flushing */ - if (GST_RPAD_IS_FLUSHING (pad)) - goto out_flushing; -#endif g_queue_push_tail (queue->queue, buffer); @@ -711,14 +703,6 @@ restart: while (gst_queue_is_empty (queue)) { STATUS (queue, "waiting for item_add"); -#if 0 - /* we are flushing */ - if (GST_RPAD_IS_FLUSHING (pad)) - goto out_flushing; - if (GST_RPAD_IS_FLUSHING (queue->sinkpad)) - goto out_flushing; -#endif - if (queue->flushing) goto out_flushing; @@ -728,13 +712,6 @@ restart: if (queue->flushing) goto out_flushing; -#if 0 - /* we got unlocked because we are flushing */ - if (GST_RPAD_IS_FLUSHING (pad)) - goto out_flushing; - if (GST_RPAD_IS_FLUSHING (queue->sinkpad)) - goto out_flushing; -#endif GST_LOG_OBJECT (queue, "done g_cond_wait using qlock from thread %p", g_thread_self ()); @@ -803,20 +780,7 @@ gst_queue_handle_src_event (GstPad * pad, GstEvent * event) GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)", event, GST_EVENT_TYPE (event)); - gst_event_ref (event); res = gst_pad_event_default (pad, event); - GST_QUEUE_MUTEX_LOCK; - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_SEEK: - if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) { - gst_queue_locked_flush (queue); - } - default: - break; - } - GST_QUEUE_MUTEX_UNLOCK; - gst_event_unref (event); return res; } diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 5fe3fb1..299f357 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -632,10 +632,7 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer) g_cond_wait (queue->item_del, queue->qlock); if (queue->flushing) -#if 0 - if (GST_RPAD_IS_FLUSHING (pad)) -#endif - goto out_flushing; + goto out_flushing; /* if there's a pending state change for this queue * or its manager, switch back to iterator so bottom @@ -650,11 +647,6 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer) break; } } -#if 0 - /* we are flushing */ - if (GST_RPAD_IS_FLUSHING (pad)) - goto out_flushing; -#endif g_queue_push_tail (queue->queue, buffer); @@ -711,14 +703,6 @@ restart: while (gst_queue_is_empty (queue)) { STATUS (queue, "waiting for item_add"); -#if 0 - /* we are flushing */ - if (GST_RPAD_IS_FLUSHING (pad)) - goto out_flushing; - if (GST_RPAD_IS_FLUSHING (queue->sinkpad)) - goto out_flushing; -#endif - if (queue->flushing) goto out_flushing; @@ -728,13 +712,6 @@ restart: if (queue->flushing) goto out_flushing; -#if 0 - /* we got unlocked because we are flushing */ - if (GST_RPAD_IS_FLUSHING (pad)) - goto out_flushing; - if (GST_RPAD_IS_FLUSHING (queue->sinkpad)) - goto out_flushing; -#endif GST_LOG_OBJECT (queue, "done g_cond_wait using qlock from thread %p", g_thread_self ()); @@ -803,20 +780,7 @@ gst_queue_handle_src_event (GstPad * pad, GstEvent * event) GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)", event, GST_EVENT_TYPE (event)); - gst_event_ref (event); res = gst_pad_event_default (pad, event); - GST_QUEUE_MUTEX_LOCK; - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_SEEK: - if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) { - gst_queue_locked_flush (queue); - } - default: - break; - } - GST_QUEUE_MUTEX_UNLOCK; - gst_event_unref (event); return res; } -- 2.7.4