mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
discoverer: Don't remove element when switching to PLAYING
There is a race going on somewhere when we attempt to remove elements *while* the parent container is switching to PLAYING. In order to avoid this issue with discoverer, make sure we never remove elements while switching to PLAYING.
This commit is contained in:
parent
9c4b3b1ee7
commit
4c2f91d69e
1 changed files with 4 additions and 1 deletions
|
@ -743,7 +743,6 @@ uridecodebin_pad_removed_cb (GstElement * uridecodebin, GstPad * pad,
|
|||
gst_pad_remove_probe (pad, ps->probe_id);
|
||||
|
||||
dc->priv->streams = g_list_delete_link (dc->priv->streams, tmp);
|
||||
DISCO_UNLOCK (dc);
|
||||
|
||||
gst_element_set_state (ps->sink, GST_STATE_NULL);
|
||||
gst_element_set_state (ps->queue, GST_STATE_NULL);
|
||||
|
@ -756,6 +755,7 @@ uridecodebin_pad_removed_cb (GstElement * uridecodebin, GstPad * pad,
|
|||
/* references removed here */
|
||||
gst_bin_remove_many (dc->priv->pipeline, ps->sink, ps->queue, NULL);
|
||||
|
||||
DISCO_UNLOCK (dc);
|
||||
if (ps->tags) {
|
||||
gst_tag_list_unref (ps->tags);
|
||||
}
|
||||
|
@ -1340,7 +1340,10 @@ discoverer_collect (GstDiscoverer * dc)
|
|||
* completely bogus values. We need some API extensions to solve this
|
||||
* better. */
|
||||
GST_INFO ("No duration yet, try a bit harder..");
|
||||
/* Make sure we don't add/remove elements while switching to PLAYING itself */
|
||||
DISCO_LOCK (dc);
|
||||
sret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
DISCO_UNLOCK (dc);
|
||||
if (sret != GST_STATE_CHANGE_FAILURE) {
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Reference in a new issue