mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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.
This commit is contained in:
parent
8e766e2d61
commit
8c26c22f2c
1 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue