mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
adaptivedemux: use gst_task_stop instead of gst_task_pause
To avoid race conditions with gst_task_stop(); gst_task_join() with another thread doing gst_task_pause(), the joining thread would be waiting for the task to stop but it would never happen. So just use gst_task_stop() everywhere to prevent more mutexes
This commit is contained in:
parent
87df15a214
commit
a7712c2983
1 changed files with 9 additions and 9 deletions
|
@ -1684,7 +1684,7 @@ no_url_error:
|
||||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
|
GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
|
||||||
(_("Failed to get fragment URL.")),
|
(_("Failed to get fragment URL.")),
|
||||||
("An error happened when getting fragment URL"));
|
("An error happened when getting fragment URL"));
|
||||||
gst_task_pause (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1704,14 +1704,14 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
|
||||||
if (GST_CLOCK_TIME_IS_VALID (demux->segment.stop)
|
if (GST_CLOCK_TIME_IS_VALID (demux->segment.stop)
|
||||||
&& stream->segment.position >= demux->segment.stop) {
|
&& stream->segment.position >= demux->segment.stop) {
|
||||||
ret = GST_FLOW_EOS;
|
ret = GST_FLOW_EOS;
|
||||||
gst_task_pause (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
goto end_of_manifest;
|
goto end_of_manifest;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (GST_CLOCK_TIME_IS_VALID (demux->segment.start)
|
if (GST_CLOCK_TIME_IS_VALID (demux->segment.start)
|
||||||
&& stream->segment.position < demux->segment.start) {
|
&& stream->segment.position < demux->segment.start) {
|
||||||
ret = GST_FLOW_EOS;
|
ret = GST_FLOW_EOS;
|
||||||
gst_task_pause (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
goto end_of_manifest;
|
goto end_of_manifest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1861,7 +1861,7 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
|
||||||
|
|
||||||
/* the subclass might want to switch pads */
|
/* the subclass might want to switch pads */
|
||||||
if (G_UNLIKELY (demux->next_streams)) {
|
if (G_UNLIKELY (demux->next_streams)) {
|
||||||
gst_task_pause (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
/* TODO only allow switching streams if other downloads are not ongoing */
|
/* TODO only allow switching streams if other downloads are not ongoing */
|
||||||
gst_adaptive_demux_expose_streams (demux);
|
gst_adaptive_demux_expose_streams (demux);
|
||||||
gst_adaptive_demux_start_tasks (demux);
|
gst_adaptive_demux_start_tasks (demux);
|
||||||
|
@ -1883,9 +1883,9 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
|
||||||
GST_MANIFEST_UNLOCK (demux);
|
GST_MANIFEST_UNLOCK (demux);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gst_task_pause (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
} else {
|
} else {
|
||||||
gst_task_pause (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
if (gst_adaptive_demux_combine_flows (demux) == GST_FLOW_EOS) {
|
if (gst_adaptive_demux_combine_flows (demux) == GST_FLOW_EOS) {
|
||||||
if (gst_adaptive_demux_has_next_period (demux)) {
|
if (gst_adaptive_demux_has_next_period (demux)) {
|
||||||
gst_adaptive_demux_advance_period (demux);
|
gst_adaptive_demux_advance_period (demux);
|
||||||
|
@ -1897,7 +1897,7 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_FLOW_NOT_LINKED:
|
case GST_FLOW_NOT_LINKED:
|
||||||
gst_task_pause (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
if (gst_adaptive_demux_combine_flows (demux)
|
if (gst_adaptive_demux_combine_flows (demux)
|
||||||
== GST_FLOW_NOT_LINKED) {
|
== GST_FLOW_NOT_LINKED) {
|
||||||
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
||||||
|
@ -1913,7 +1913,7 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
|
||||||
GstAdaptiveDemuxStream *other;
|
GstAdaptiveDemuxStream *other;
|
||||||
|
|
||||||
other = iter->data;
|
other = iter->data;
|
||||||
gst_task_pause (other->download_task);
|
gst_task_stop (other->download_task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2080,7 +2080,7 @@ gst_adaptive_demux_updates_loop (GstAdaptiveDemux * demux)
|
||||||
quit:
|
quit:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (demux, "Stopped updates task");
|
GST_DEBUG_OBJECT (demux, "Stopped updates task");
|
||||||
gst_task_pause (demux->priv->updates_task);
|
gst_task_stop (demux->priv->updates_task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue