summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2016-07-13 23:02:10 +1000
committerJan Schmidt <jan@centricular.com>2016-07-26 01:34:47 +1000
commite3e9c4f83c596530c920f75ebd4863f7845a08dc (patch)
tree4ea7a8cd802703ef8b7e15285c12dc8cdb3e1851
parent3db0222b32f711e62e798335a94a532e969d3b09 (diff)
downloadgstreamer-plugins-bad-e3e9c4f83c596530c920f75ebd4863f7845a08dc.tar.gz
adaptivedemux: More locking/switching fixes
Release the manifest lock when signalling no-more-pads, as that can call back into adaptivedemux again Partial cherry-pick of 03f96d
-rw-r--r--gst-libs/gst/adaptivedemux/gstadaptivedemux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
index 729935457..515283b04 100644
--- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
+++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
@@ -1013,7 +1013,9 @@ gst_adaptive_demux_expose_streams (GstAdaptiveDemux * demux,
gst_event_set_seqnum (stream->pending_segment, demux->priv->segment_seqnum);
}
+ GST_MANIFEST_UNLOCK (demux);
gst_element_no_more_pads (GST_ELEMENT_CAST (demux));
+ GST_MANIFEST_LOCK (demux);
if (old_streams) {
GstEvent *eos = gst_event_new_eos ();
@@ -2553,6 +2555,8 @@ gst_adaptive_demux_stream_download_uri (GstAdaptiveDemux * demux,
*/
GST_MANIFEST_UNLOCK (demux);
+ /* FIXME: Wait until the src pad is IDLE, as it might be blocked
+ * downstream indefinitely here */
gst_element_set_state (stream->src, GST_STATE_READY);
GST_MANIFEST_LOCK (demux);
@@ -3293,6 +3297,7 @@ gst_adaptive_demux_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux,
/* the subclass might want to switch pads */
if (G_UNLIKELY (demux->next_streams)) {
gst_task_stop (stream->download_task);
+
/* TODO only allow switching streams if other downloads are not ongoing */
GST_DEBUG_OBJECT (demux, "Subclass wants new pads "
"to do bitrate switching");