GstState deactivated_elements_state;
GstElement *current_bin;
+
+
+ gboolean seeking_itself;
};
static guint _signals[LAST_SIGNAL] = { 0 };
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
{
- _add_seek_gsource (comp, event);
- event = NULL;
- GST_FIXME_OBJECT (comp, "HANDLE seeking errors!");
+ if (!priv->seeking_itself) {
+ _add_seek_gsource (comp, event);
+ event = NULL;
+ GST_FIXME_OBJECT (comp, "HANDLE seeking errors!");
+
+ return TRUE;
+ }
- return TRUE;
+ break;
}
case GST_EVENT_QOS:
{
}
/* Activate stack */
- if (samestack && (startchanged || stopchanged)) {
- /* Update seek events need to be flushing if not in PLAYING,
- * else we will encounter deadlocks. */
- forcing_flush = (state == GST_STATE_PLAYING) ? FALSE : TRUE;
- }
+ if (!samestack) {
+ return _activate_new_stack (comp, initial);
+ } else {
+ gboolean res;
+ GstEvent *toplevel_seek;
+ GstPad *peer = gst_pad_get_peer (GNL_OBJECT_SRC (comp));
+
+ if (samestack && (startchanged || stopchanged)) {
+ /* Update seek events need to be flushing if not in PLAYING,
+ * else we will encounter deadlocks. */
+ forcing_flush = (state == GST_STATE_PLAYING) ? FALSE : TRUE;
+ }
+ toplevel_seek = get_new_seek_event (comp, TRUE, forcing_flush);
- _activate_new_stack (comp, forcing_flush);
- return TRUE;
+ priv->seeking_itself = TRUE;
+ res = gst_pad_push_event (peer, toplevel_seek);
+ priv->seeking_itself = FALSE;
+
+ return res;
+ }
}
static gboolean
GST_ERROR ("doing one commit");
commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source1, "source1", 2);
+ ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Second source */
gnl_composition_add (GST_BIN (comp), source2);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
commit_and_wait (comp, &ret);
- ASSERT_OBJECT_REFCOUNT (source2, "source2", 2);
+ ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
/* Remove first source */
commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
gst_object_unref (source1);
- ASSERT_OBJECT_REFCOUNT (source1, "source1", 2);
+ ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Expected segments */
segments = g_list_append (segments,
commit_and_wait (comp, &ret);
check_start_stop_duration (comp, GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source1, "source1", 2);
+ ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* defaultsrc source */
gnl_composition_add (GST_BIN (comp), defaultsrc);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 2 * GST_SECOND, 2 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (defaultsrc, "defaultsrc", 2);
+ ASSERT_OBJECT_REFCOUNT (defaultsrc, "defaultsrc", 1);
/* Second source */
check_start_stop_duration (comp, 0, 5 * GST_SECOND, 5 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source3, "source3", 2);
+ ASSERT_OBJECT_REFCOUNT (source3, "source3", 1);
/* Expected segments */
segments = g_list_append (segments,
commit_and_wait (comp, &ret);
check_start_stop_duration (comp, GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source1, "source1", 2);
+ ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* defaultsrc source */
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 2 * GST_SECOND, 2 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (defaultsrc, "defaultsrc", 2);
+ ASSERT_OBJECT_REFCOUNT (defaultsrc, "defaultsrc", 1);
/* Second source */
check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 4 * GST_SECOND, 4 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source2, "source2", 2);
+ ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
/* Third source */
check_start_stop_duration (comp, 0, 5 * GST_SECOND, 5 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source3, "source3", 2);
+ ASSERT_OBJECT_REFCOUNT (source3, "source3", 1);
/* Expected segments */
segments = g_list_append (segments,
commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source1, "source1", 2);
+ ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Second source */
commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source2, "source2", 2);
+ ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
/* Third source */
commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
- ASSERT_OBJECT_REFCOUNT (source3, "source3", 2);
+ ASSERT_OBJECT_REFCOUNT (source3, "source3", 1);
sink = gst_element_factory_make_or_warn ("fakesink", "sink");
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
GST_DEBUG ("Setting pipeline to PLAYING");
- ASSERT_OBJECT_REFCOUNT (source1, "source1", 2);
+ ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);