diff --git a/common b/common
index 7412249..bcb1518 160000
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 7412249950b9fb00f78feb26277f84233fa4e4b4
+Subproject commit bcb1518c08c889dd7eda06936fc26cad85fac755
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index 84e2c7b..baadd29 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -88,6 +88,14 @@ gst_input_selector_sync_mode_get_type (void)
 #define GST_INPUT_SELECTOR_WAIT(sel) (g_cond_wait (GST_INPUT_SELECTOR_GET_COND(sel), \
 			GST_INPUT_SELECTOR_GET_LOCK(sel)))
 #define GST_INPUT_SELECTOR_BROADCAST(sel) (g_cond_broadcast (GST_INPUT_SELECTOR_GET_COND(sel)))
+#define GST_INPUT_PAD_GET_LOCK(selpad) (&((GstSelectorPad*)(selpad))->lock)
+#define GST_INPUT_PAD_GET_COND(selpad) (&((GstSelectorPad*)(selpad))->cond)
+#define GST_INPUT_PAD_LOCK(selpad) (g_mutex_lock (GST_INPUT_PAD_GET_LOCK(selpad)))
+#define GST_INPUT_PAD_UNLOCK(selpad) (g_mutex_unlock (GST_INPUT_PAD_GET_LOCK(selpad)))
+#define GST_INPUT_PAD_WAIT(selpad) (g_cond_wait (GST_INPUT_PAD_GET_COND(selpad), \
+			GST_INPUT_PAD_GET_LOCK(selpad)))
+#define GST_INPUT_PAD_BROADCAST(selpad) (g_cond_broadcast (GST_INPUT_PAD_GET_COND(selpad)))
+
 
 static GstStaticPadTemplate gst_input_selector_sink_factory =
 GST_STATIC_PAD_TEMPLATE ("sink_%u",
@@ -179,6 +187,9 @@ struct _GstSelectorPad
 
   gboolean events_pending;      /* TRUE if sticky events need to be updated */
 
+  GMutex lock;
+  GCond cond;
+
   gboolean sending_cached_buffers;
   GQueue *cached_buffers;
 };
@@ -253,6 +264,8 @@ gst_selector_pad_init (GstSelectorPad * pad)
 {
   pad->always_ok = DEFAULT_PAD_ALWAYS_OK;
   gst_selector_pad_reset (pad);
+  g_mutex_init (&pad->lock);
+  g_cond_init (&pad->cond);
 }
 
 static void
@@ -266,6 +279,9 @@ gst_selector_pad_finalize (GObject * object)
     gst_tag_list_unref (pad->tags);
   gst_selector_pad_free_cached_buffers (pad);
 
+  g_mutex_clear (&pad->lock);
+  g_cond_clear (&pad->cond);
+
   G_OBJECT_CLASS (gst_selector_pad_parent_class)->finalize (object);
 }
 
@@ -550,6 +566,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
         active_selpad = GST_SELECTOR_PAD (active_sinkpad);
         forward = (active_selpad->eos && !active_selpad->eos_sent);
         active_selpad->eos_sent = TRUE;
+        GST_INPUT_PAD_WAIT (selpad);
       }
       GST_DEBUG_OBJECT (pad, "received EOS");
       break;
@@ -1387,6 +1404,10 @@ gst_input_selector_set_active_pad (GstInputSelector * self, GstPad * pad)
   GST_DEBUG_OBJECT (self, "New active pad is %" GST_PTR_FORMAT,
       self->active_sinkpad);
 
+  if (old != new && new->eos && !new->eos_sent) {
+    GST_INPUT_PAD_BROADCAST (new);
+  }
+
   return TRUE;
 }
 
@@ -1727,11 +1748,17 @@ static void
 gst_input_selector_release_pad (GstElement * element, GstPad * pad)
 {
   GstInputSelector *sel;
+  GstSelectorPad *selpad;
+
+  selpad = GST_SELECTOR_PAD_CAST (pad);
 
   sel = GST_INPUT_SELECTOR (element);
   GST_LOG_OBJECT (sel, "Releasing pad %s:%s", GST_DEBUG_PAD_NAME (pad));
 
   GST_INPUT_SELECTOR_LOCK (sel);
+
+  GST_INPUT_PAD_BROADCAST (selpad);
+
   /* if the pad was the active pad, makes us select a new one */
   if (sel->active_sinkpad == pad) {
     GST_DEBUG_OBJECT (sel, "Deactivating pad %s:%s", GST_DEBUG_PAD_NAME (pad));
