--- a/gst/playback/gststreamsynchronizer.c
+++ b/gst/playback/gststreamsynchronizer.c
@@ -226,6 +226,56 @@ out:
   return ret;
 }
 
+static gboolean
+gst_stream_synchronizer_unblock_all (GstStreamSynchronizer * self)
+{
+  GList *l;
+  gboolean all_wait = TRUE;
+
+  for (l = self->streams; l; l = l->next) {
+    GstStream *ostream = l->data;
+
+    all_wait = all_wait && ostream->wait;
+    if (!all_wait)
+      break;
+  }
+
+  if (all_wait) {
+    gint64 position = 0;
+
+    GST_DEBUG_OBJECT (self, "All streams have changed -- unblocking");
+
+    for (l = self->streams; l; l = l->next) {
+      GstStream *ostream = l->data;
+      gint64 stop_running_time;
+      gint64 position_running_time;
+
+      ostream->wait = FALSE;
+
+      if (ostream->segment.format == GST_FORMAT_TIME) {
+        stop_running_time =
+            gst_segment_to_running_time (&ostream->segment,
+            GST_FORMAT_TIME, ostream->segment.stop);
+        position_running_time =
+            gst_segment_to_running_time (&ostream->segment,
+            GST_FORMAT_TIME, ostream->segment.position);
+        position =
+            MAX (position, MAX (stop_running_time, position_running_time));
+      }
+    }
+    position = MAX (0, position);
+    self->group_start_time = MAX (self->group_start_time, position);
+
+    GST_DEBUG_OBJECT (self, "New group start time: %" GST_TIME_FORMAT,
+        GST_TIME_ARGS (self->group_start_time));
+
+    for (l = self->streams; l; l = l->next) {
+      GstStream *ostream = l->data;
+      g_cond_broadcast (&ostream->stream_finish_cond);
+    }
+  }
+}
+
 /* sinkpad functions */
 static gboolean
 gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
@@ -243,8 +293,6 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
     {
       GstStream *stream;
       guint32 seqnum = gst_event_get_seqnum (event);
-      GList *l;
-      gboolean all_wait = TRUE;
 
       GST_STREAM_SYNCHRONIZER_LOCK (self);
       stream = gst_pad_get_element_private (pad);
@@ -256,48 +304,8 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
         stream->wait = TRUE;
         stream->new_stream = TRUE;
 
-        for (l = self->streams; l; l = l->next) {
-          GstStream *ostream = l->data;
+        gst_stream_synchronizer_unblock_all (self);
 
-          all_wait = all_wait && ostream->wait;
-          if (!all_wait)
-            break;
-        }
-        if (all_wait) {
-          gint64 position = 0;
-
-          GST_DEBUG_OBJECT (self, "All streams have changed -- unblocking");
-
-          for (l = self->streams; l; l = l->next) {
-            GstStream *ostream = l->data;
-            gint64 stop_running_time;
-            gint64 position_running_time;
-
-            ostream->wait = FALSE;
-
-            if (ostream->segment.format == GST_FORMAT_TIME) {
-              stop_running_time =
-                  gst_segment_to_running_time (&ostream->segment,
-                  GST_FORMAT_TIME, ostream->segment.stop);
-              position_running_time =
-                  gst_segment_to_running_time (&ostream->segment,
-                  GST_FORMAT_TIME, ostream->segment.position);
-              position =
-                  MAX (position, MAX (stop_running_time,
-                      position_running_time));
-            }
-          }
-          position = MAX (0, position);
-          self->group_start_time = MAX (self->group_start_time, position);
-
-          GST_DEBUG_OBJECT (self, "New group start time: %" GST_TIME_FORMAT,
-              GST_TIME_ARGS (self->group_start_time));
-
-          for (l = self->streams; l; l = l->next) {
-            GstStream *ostream = l->data;
-            g_cond_broadcast (&ostream->stream_finish_cond);
-          }
-        }
       } else
         GST_DEBUG_OBJECT (self, "No stream or STREAM_START from same source");
       GST_STREAM_SYNCHRONIZER_UNLOCK (self);
@@ -359,6 +367,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
         /* Since this stream is not time-based, we mark it so that
          * other streams don't wait forever on it */
         stream->wait = TRUE;
+        gst_stream_synchronizer_unblock_all (self);
       }
       GST_STREAM_SYNCHRONIZER_UNLOCK (self);
       break;
