From d5432c2bff0a41b2d9bc66b4aed6e47721775b5a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 6 Nov 2007 12:28:17 +0000 Subject: [PATCH] gst/gstelement.c: Only change the state cookie if a different state was set on the element. See #492729. Original commit message from CVS: * gst/gstelement.c: (gst_element_set_state_func): Only change the state cookie if a different state was set on the element. See #492729. --- ChangeLog | 6 ++++++ gst/gstelement.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fcf3767f5..9aa2e26311 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-11-06 Wim Taymans + + * gst/gstelement.c: (gst_element_set_state_func): + Only change the state cookie if a different state was set on the + element. See #492729. + 2007-11-06 Tim-Philipp Müller * gst/gstvalue.c: diff --git a/gst/gstelement.c b/gst/gstelement.c index 6fcd468703..9e97fde479 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -2300,12 +2300,15 @@ gst_element_set_state_func (GstElement * element, GstState state) current = GST_STATE (element); next = GST_STATE_NEXT (element); old_pending = GST_STATE_PENDING (element); - /* increment state cookie so that we can track each state change */ - element->state_cookie++; /* this is the (new) state we should go to. TARGET is the last state we set on * the element. */ - GST_STATE_TARGET (element) = state; + if (state != GST_STATE_TARGET (element)) { + GST_STATE_TARGET (element) = state; + /* increment state cookie so that we can track each state change. We only do + * this if this is actually a new state change. */ + element->state_cookie++; + } GST_STATE_PENDING (element) = state; GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,