mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
inputselector: Wake up streaming thread before PLAYING_TO_PAUSED transition
Also take object lock before iterating the pads. https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1772 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4190>
This commit is contained in:
parent
aef4caf3a0
commit
e9faf63d2e
1 changed files with 6 additions and 4 deletions
|
@ -2045,6 +2045,10 @@ gst_input_selector_change_state (GstElement * element,
|
|||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:{
|
||||
GList *walk;
|
||||
|
||||
GST_INPUT_SELECTOR_LOCK (self);
|
||||
self->playing = FALSE;
|
||||
GST_INPUT_SELECTOR_BROADCAST (self);
|
||||
GST_OBJECT_LOCK (self);
|
||||
for (walk = GST_ELEMENT_CAST (self)->sinkpads; walk;
|
||||
walk = g_list_next (walk)) {
|
||||
GstSelectorPad *selpad = GST_SELECTOR_PAD_CAST (walk->data);
|
||||
|
@ -2053,6 +2057,8 @@ gst_input_selector_change_state (GstElement * element,
|
|||
gst_clock_id_unschedule (selpad->clock_id);
|
||||
}
|
||||
}
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
GST_INPUT_SELECTOR_UNLOCK (self);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -2065,10 +2071,6 @@ gst_input_selector_change_state (GstElement * element,
|
|||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
gst_input_selector_reset (self);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
GST_INPUT_SELECTOR_LOCK (self);
|
||||
self->playing = FALSE;
|
||||
GST_INPUT_SELECTOR_UNLOCK (self);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue