GNOME Bugzilla – Bug 788417
hls: Fix media sequence handling when encountering loops
Last modified: 2017-10-19 13:48:31 UTC
Don't try to match URIs when we have media sequences. It is legal for a stream to reuse segments (marking discontinuities as needed). Uplynk delivers such playlists for their placeholder loops. Leave the URI scanning in place for playlists which have no EXT-X-MEDIA-SEQUENCE tag. This should be harmless since the spec requires these playlists to not be missing segments (RFC8216 6.2.2), so we should be always matching on the first segment. Also do a bunch of refactoring. Patches follow.
Created attachment 360741 [details] [review] [PATCH 1/5] m3u8: Simplify control flow for sequence update Split the tail from the rest of the loop.
Created attachment 360742 [details] [review] [PATCH 2/5] m3u8: Split gst_m3u8_update_check_consistent_media_seqnums The function was basically one big if-else. Move the branch to the one caller. Currently, it's never called with previous_files == NULL. Assert that this continues.
Created attachment 360743 [details] [review] [PATCH 3/5] m3u8: Ignore empty playlists in check_media_seqnums Let these error in the immediately following check in gst_m3u8_update.
Created attachment 360744 [details] [review] [PATCH 4/5] m3u8: Don't try to match URIs when we have media sequences It is legal for a stream to reuse segments (marking discontinuities as needed). Uplynk delivers such playlists for their placeholder loops. Leave the URI scanning in place for playlists which have no EXT-X-MEDIA-SEQUENCE tag. This should be harmless since the spec requires these playlists to not be missing segments (RFC8216 6.2.2), so we should be always matching on the first segment.
Created attachment 360745 [details] [review] [PATCH 5/5] m3u8: Refine sequence update debug messages Actually give some details about why it failed.