mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
mssdemux: some fixes to bitrate switching
Removes a possible deadlock from bitrate switching when the pad that requested the switch blocks on its pad-push
This commit is contained in:
parent
6ca10e6c1b
commit
fba63178fe
1 changed files with 6 additions and 3 deletions
|
@ -735,16 +735,19 @@ gst_mss_demux_reconfigure (GstMssDemux * mssdemux)
|
||||||
/* if we changed the bitrate, we need to add new pads */
|
/* if we changed the bitrate, we need to add new pads */
|
||||||
for (iter = mssdemux->streams; iter; iter = g_slist_next (iter)) {
|
for (iter = mssdemux->streams; iter; iter = g_slist_next (iter)) {
|
||||||
GstMssDemuxStream *stream = iter->data;
|
GstMssDemuxStream *stream = iter->data;
|
||||||
|
GstPad *oldpad = stream->pad;
|
||||||
GstClockTime ts =
|
GstClockTime ts =
|
||||||
gst_mss_stream_get_fragment_gst_timestamp (stream->manifest_stream);
|
gst_mss_stream_get_fragment_gst_timestamp (stream->manifest_stream);
|
||||||
|
|
||||||
oldpads = g_slist_prepend (oldpads, stream->pad);
|
oldpads = g_slist_prepend (oldpads, oldpad);
|
||||||
|
|
||||||
stream->pad = _create_pad (mssdemux, stream->manifest_stream);
|
stream->pad = _create_pad (mssdemux, stream->manifest_stream);
|
||||||
/* TODO keep the same playback rate */
|
/* TODO keep the same playback rate */
|
||||||
stream->pending_newsegment =
|
stream->pending_newsegment =
|
||||||
gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, ts, -1, ts);
|
gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, ts, -1, ts);
|
||||||
gst_mss_demux_expose_stream (mssdemux, stream);
|
gst_mss_demux_expose_stream (mssdemux, stream);
|
||||||
|
|
||||||
|
gst_pad_push_event (oldpad, gst_event_new_eos ());
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_element_no_more_pads (GST_ELEMENT (mssdemux));
|
gst_element_no_more_pads (GST_ELEMENT (mssdemux));
|
||||||
|
@ -752,8 +755,6 @@ gst_mss_demux_reconfigure (GstMssDemux * mssdemux)
|
||||||
for (iter = oldpads; iter; iter = g_slist_next (iter)) {
|
for (iter = oldpads; iter; iter = g_slist_next (iter)) {
|
||||||
GstPad *oldpad = iter->data;
|
GstPad *oldpad = iter->data;
|
||||||
|
|
||||||
/* Push out EOS */
|
|
||||||
gst_pad_push_event (oldpad, gst_event_new_eos ());
|
|
||||||
gst_pad_set_active (oldpad, FALSE);
|
gst_pad_set_active (oldpad, FALSE);
|
||||||
gst_element_remove_pad (GST_ELEMENT (mssdemux), oldpad);
|
gst_element_remove_pad (GST_ELEMENT (mssdemux), oldpad);
|
||||||
gst_object_unref (oldpad);
|
gst_object_unref (oldpad);
|
||||||
|
@ -846,6 +847,8 @@ gst_mss_demux_stream_loop (GstMssDemuxStream * stream)
|
||||||
g_thread_create ((GThreadFunc) gst_mss_demux_reconfigure, mssdemux, FALSE,
|
g_thread_create ((GThreadFunc) gst_mss_demux_reconfigure, mssdemux, FALSE,
|
||||||
NULL);
|
NULL);
|
||||||
GST_DEBUG_OBJECT (mssdemux, "Finished streams reconfiguration");
|
GST_DEBUG_OBJECT (mssdemux, "Finished streams reconfiguration");
|
||||||
|
gst_task_stop (stream->stream_task);
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
GST_OBJECT_UNLOCK (mssdemux);
|
GST_OBJECT_UNLOCK (mssdemux);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue