[gst-cvs] gstreamer: element: fix posting of async-start messages
Wim Taymans
wtay at kemper.freedesktop.org
Tue May 12 01:23:26 PDT 2009
Module: gstreamer
Branch: master
Commit: 8c26c22f2c5f976695e1f5874aaba68286b46d38
URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=8c26c22f2c5f976695e1f5874aaba68286b46d38
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Tue Apr 28 19:20:31 2009 +0200
element: fix posting of async-start messages
When an element lost its state but was busy doing a state change, still post the
async-start message with the base_time reset flag or else we might end up with
an old base_time.
this can happen when a sink is goin async to paused and then a flushing seek is
performed. This would cause the base_time to remain unmodified because the
async-start message was not sent.
---
gst/gstelement.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/gst/gstelement.c b/gst/gstelement.c
index d4fdb25..3d56e59 100644
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
@@ -2209,10 +2209,12 @@ gst_element_lost_state (GstElement * element)
g_return_if_fail (GST_IS_ELEMENT (element));
GST_OBJECT_LOCK (element);
- if (GST_STATE_PENDING (element) != GST_STATE_VOID_PENDING ||
- GST_STATE_RETURN (element) == GST_STATE_CHANGE_FAILURE)
+ if (GST_STATE_RETURN (element) == GST_STATE_CHANGE_FAILURE)
goto nothing_lost;
+ if (GST_STATE_PENDING (element) != GST_STATE_VOID_PENDING)
+ goto only_async_start;
+
old_state = GST_STATE (element);
/* when we were PLAYING, the new state is PAUSED. We will also not
@@ -2247,6 +2249,14 @@ nothing_lost:
GST_OBJECT_UNLOCK (element);
return;
}
+only_async_start:
+ {
+ GST_OBJECT_UNLOCK (element);
+
+ message = gst_message_new_async_start (GST_OBJECT_CAST (element), TRUE);
+ gst_element_post_message (element, message);
+ return;
+ }
}
/**
More information about the Gstreamer-commits
mailing list