summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2022-06-01 15:45:23 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2022-06-28 17:59:23 +0000
commitb9effe04e3cb6a3de9751573fb546ff348b72cb2 (patch)
tree29243db3679e290531d1dfb04787f0daea82ee9d
parent87ab729551168dc44da7d1aa0cd9c384419f2371 (diff)
hlsdemux2: Use variant stream as support for synchronizing playlists
When matching playlists, there is a possibility that rendition streams will not have been updated in time (for example because that stream started later, or playback was paused). This would cause several playback failures and seeking failures. In order to still fall back on our feet, attempt to synchronize that rendition playlist against the current variant playlist. This will attempt to match the stream time using SN/DNS/PDT/... Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
-rw-r--r--subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c
index 23ee1ae223..e21264cbde 100644
--- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c
+++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c
@@ -1955,10 +1955,20 @@ gst_hls_demux_stream_update_media_playlist (GstHLSDemux * demux,
if (stream->playlist) {
if (!gst_hls_media_playlist_sync_to_playlist (new_playlist,
stream->playlist)) {
- /* FIXME : We need to have a way to re-calculate sync ! */
- GST_ERROR_OBJECT (stream,
- "Could not synchronize new playlist with previous one !");
- return FALSE;
+ /* Failure to sync is only fatal for variant streams. */
+ if (stream->is_variant) {
+ GST_ERROR_OBJECT (stream,
+ "Could not synchronize new variant playlist with previous one !");
+ return FALSE;
+ }
+ /* For rendition streams, we can attempt synchronization against the
+ * variant playlist which is constantly updated */
+ if (!gst_hls_media_playlist_sync_to_playlist (new_playlist,
+ demux->main_stream->playlist)) {
+ GST_ERROR_OBJECT (stream,
+ "Could not do fallback synchronization of rendition stream to variant stream");
+ return FALSE;
+ }
}
}