gst/playback/gstplaybin.c: Only seek on one sink, the first one that succeeds.
authorWim Taymans <wim.taymans@gmail.com>
Thu, 22 Sep 2005 17:41:03 +0000 (17:41 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 22 Sep 2005 17:41:03 +0000 (17:41 +0000)
Original commit message from CVS:
* gst/playback/gstplaybin.c: (gst_play_bin_class_init),
(gst_play_bin_send_event):
Only seek on one sink, the first one that succeeds.

ChangeLog
gst/playback/gstplaybin.c

index 29a4f37..f222960 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-22  Wim Taymans  <wim@fluendo.com>
+
+       * gst/playback/gstplaybin.c: (gst_play_bin_class_init),
+       (gst_play_bin_send_event):
+       Only seek on one sink, the first one that succeeds.
+
 2005-09-22  Michael Smith <msmith@fluendo.com>
 
        * ext/vorbis/vorbisenc.c: (gst_vorbisenc_clear),
index 4d438af..727c905 100644 (file)
@@ -101,6 +101,9 @@ static void gst_play_bin_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * spec);
 static void gst_play_bin_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * spec);
+
+static gboolean gst_play_bin_send_event (GstElement * element,
+    GstEvent * event);
 static GstStateChangeReturn gst_play_bin_change_state (GstElement * element,
     GstStateChange transition);
 
@@ -190,6 +193,7 @@ gst_play_bin_class_init (GstPlayBinClass * klass)
 
   gstelement_klass->change_state =
       GST_DEBUG_FUNCPTR (gst_play_bin_change_state);
+  gstelement_klass->send_event = GST_DEBUG_FUNCPTR (gst_play_bin_send_event);
 
   playbasebin_klass->setup_output_pads = setup_sinks;
 }
@@ -849,6 +853,28 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group)
   }
 }
 
+static gboolean
+gst_play_bin_send_event (GstElement * element, GstEvent * event)
+{
+  GstPlayBin *play_bin;
+  GList *sinks;
+  gboolean res = FALSE;
+
+  play_bin = GST_PLAY_BIN (element);
+
+  sinks = play_bin->sinks;
+  while (sinks) {
+    GstElement *sink = GST_ELEMENT_CAST (sinks->data);
+
+    if ((res = gst_element_send_event (sink, event)))
+      break;
+
+    sinks = g_list_next (sinks);
+  }
+
+  return res;
+}
+
 static GstStateChangeReturn
 gst_play_bin_change_state (GstElement * element, GstStateChange transition)
 {