hlsdemux2: Immediately request playlist after URI changes

When the stream switches to a new playlist / variant while the loader is waiting
on a timer to refresh the old playlist, cancel the timer and submit the request
for the new URI.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
Jan Schmidt 2023-01-02 22:32:13 +11:00 committed by GStreamer Marge Bot
parent 6d7d3d93e6
commit b1354058e1

View file

@ -264,7 +264,14 @@ gst_hls_demux_playlist_loader_set_playlist_uri (GstHLSDemuxPlaylistLoader * pl,
}
break;
case PLAYLIST_LOADER_STATE_WAITING:
return; /* Already waiting for the next time to load a live playlist */
/* Waiting for the next time to load a live playlist, but the playlist has changed so
* cancel that and trigger a new one */
g_assert (priv->pending_cb_id != 0);
gst_adaptive_demux_loop_cancel_call (priv->scheduler_task,
priv->pending_cb_id);
priv->pending_cb_id = 0;
schedule_state_update (pl, priv);
break;
}
}