summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-12-24 13:46:28 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-12-24 13:46:28 +0100
commitbc1ec4ec5f4879747c0535a163e704afa7f33654 (patch)
tree84fffd3beafef7e14ed4c95f41576ee3041afabf /plugins
parenta1c183417f0a93f0669f8c561a38fe39fdafd453 (diff)
inputselector: Use the same waiting function for EOS and non-EOS waiting
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstinputselector.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index 29754cd22..b5da039a5 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -434,10 +434,12 @@ gst_selector_pad_iterate_linked_pads (GstPad * pad, GstObject * parent)
return it;
}
+/* must be called with the SELECTOR_LOCK, will block while the pad is blocked
+ * or return TRUE when flushing */
static gboolean
-gst_input_selector_eos_wait (GstInputSelector * self, GstSelectorPad * pad)
+gst_input_selector_wait (GstInputSelector * self, GstSelectorPad * pad)
{
- while (!self->eos && !self->flushing && !pad->flushing) {
+ while (!self->eos && self->blocked && !self->flushing && !pad->flushing) {
/* we can be unlocked here when we are shutting down (flushing) or when we
* get unblocked */
GST_INPUT_SELECTOR_WAIT (self);
@@ -534,7 +536,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
if (!forward) {
/* blocked until active the sind pad or flush */
- gst_input_selector_eos_wait (sel, selpad);
+ gst_input_selector_wait (sel, selpad);
forward = TRUE;
} else {
/* Notify all waiting pads about going EOS now */
@@ -629,19 +631,6 @@ done:
return res;
}
-/* must be called with the SELECTOR_LOCK, will block while the pad is blocked
- * or return TRUE when flushing */
-static gboolean
-gst_input_selector_wait (GstInputSelector * self, GstSelectorPad * pad)
-{
- while (self->blocked && !self->flushing && !pad->flushing) {
- /* we can be unlocked here when we are shutting down (flushing) or when we
- * get unblocked */
- GST_INPUT_SELECTOR_WAIT (self);
- }
- return self->flushing;
-}
-
static GstClockTime
gst_input_selector_get_clipped_running_time (GstSegment * seg, GstBuffer * buf)
{