mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-10 05:41:24 +00:00
adaptivedemux2: wake waiting streams upon completed manifest downlaod
Fixes race when a live stream finishes playing all segments from a dynamic manifest and waits for its update. If the manifest meanwhile changes from dynamic to static and this update is received asynchronously, periodic calls of gst_adaptive_demux_manifest_update_cb will stop. As a result the blocked stream won't get notified about the updated manifest and will remain stuck indefinitely. Also removed the wake-up code from gst_adaptive_demux_manifest_update_cb where it remained as a relic from previous implementation when manifest updates were synchronous. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8587>
This commit is contained in:
parent
f37b820060
commit
1248e4c462
1 changed files with 11 additions and 11 deletions
|
@ -3061,17 +3061,6 @@ gst_adaptive_demux_manifest_update_cb (GstAdaptiveDemux * demux)
|
|||
if (ret == GST_FLOW_OK) {
|
||||
GST_DEBUG_OBJECT (demux, "Updated playlist successfully");
|
||||
demux->priv->update_failed_count = 0;
|
||||
|
||||
/* Wake up download tasks */
|
||||
if (demux->priv->stream_waiting_for_manifest) {
|
||||
GList *iter;
|
||||
|
||||
for (iter = demux->input_period->streams; iter; iter = g_list_next (iter)) {
|
||||
GstAdaptiveDemux2Stream *stream = iter->data;
|
||||
gst_adaptive_demux2_stream_on_manifest_update (stream);
|
||||
}
|
||||
demux->priv->stream_waiting_for_manifest = FALSE;
|
||||
}
|
||||
} else if (ret == GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC) {
|
||||
schedule_again = FALSE;
|
||||
gst_adaptive_demux_handle_lost_sync (demux);
|
||||
|
@ -3795,6 +3784,17 @@ handle_manifest_download_complete (DownloadRequest * request,
|
|||
"Duration unknown, can not send the duration message");
|
||||
}
|
||||
|
||||
/* Wake up download tasks */
|
||||
if (demux->priv->stream_waiting_for_manifest) {
|
||||
GList *iter;
|
||||
|
||||
for (iter = demux->input_period->streams; iter; iter = g_list_next (iter)) {
|
||||
GstAdaptiveDemux2Stream *stream = iter->data;
|
||||
gst_adaptive_demux2_stream_on_manifest_update (stream);
|
||||
}
|
||||
demux->priv->stream_waiting_for_manifest = FALSE;
|
||||
}
|
||||
|
||||
/* If a manifest changes it's liveness or periodic updateness, we need
|
||||
* to start/stop the manifest update task appropriately */
|
||||
/* Keep this condition in sync with the one in
|
||||
|
|
Loading…
Reference in a new issue