mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-27 08:48:19 +00:00
streamsynchronizer: drop lock when pushing eos downstream
... to prevent deadlock (e.g. upon seek) when downstream waits in preroll.
This commit is contained in:
parent
837d524ef0
commit
385446bc90
|
@ -454,6 +454,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event)
|
||||||
GstStream *stream;
|
GstStream *stream;
|
||||||
GList *l;
|
GList *l;
|
||||||
gboolean all_eos = TRUE;
|
gboolean all_eos = TRUE;
|
||||||
|
GSList *pads = NULL;
|
||||||
|
|
||||||
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
||||||
stream = gst_pad_get_element_private (pad);
|
stream = gst_pad_get_element_private (pad);
|
||||||
|
@ -471,16 +472,31 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (all_eos) {
|
if (all_eos) {
|
||||||
ret = TRUE;
|
|
||||||
GST_DEBUG_OBJECT (self, "All streams are EOS -- forwarding");
|
GST_DEBUG_OBJECT (self, "All streams are EOS -- forwarding");
|
||||||
for (l = self->streams; l; l = l->next) {
|
for (l = self->streams; l; l = l->next) {
|
||||||
GstStream *ostream = l->data;
|
GstStream *ostream = l->data;
|
||||||
ret = ret
|
/* local snapshot of current pads */
|
||||||
&& gst_pad_push_event (ostream->srcpad, gst_event_new_eos ());
|
gst_object_ref (ostream->srcpad);
|
||||||
|
pads = g_slist_prepend (pads, ostream->srcpad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GST_STREAM_SYNCHRONIZER_UNLOCK (self);
|
GST_STREAM_SYNCHRONIZER_UNLOCK (self);
|
||||||
|
/* drop lock when sending eos, which may block in e.g. preroll */
|
||||||
|
if (pads) {
|
||||||
|
GstPad *pad;
|
||||||
|
GSList *epad;
|
||||||
|
|
||||||
|
ret = TRUE;
|
||||||
|
epad = pads;
|
||||||
|
while (epad) {
|
||||||
|
pad = epad->data;
|
||||||
|
GST_DEBUG_OBJECT (pad, "Pushing EOS");
|
||||||
|
ret = ret && gst_pad_push_event (pad, gst_event_new_eos ());
|
||||||
|
gst_object_unref (pad);
|
||||||
|
epad = g_slist_next (epad);
|
||||||
|
}
|
||||||
|
g_slist_free (pads);
|
||||||
|
}
|
||||||
goto done;
|
goto done;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue