Commit graph

14 commits

Author SHA1 Message Date
Edward Hervey 124f93a05d hlsdemux2: Fix crash on live playlist with single entry
If there is a single entry, we would end up computing a minimum distance of 0,
and would therefore read entries from after the segment array

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3024>
2022-09-14 15:14:08 +01:00
Jan Schmidt a6eb725413 hlsdemux2: m3u8: Fix memory leaks on parsing
Fix memory leaks when parsing of an m3u8 file is
incomplete, with EXTINF or EXT-X-PROGRAM-DATE-TIME
directives, but no segment url.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Jan Schmidt 0ff317f107 hlsdemux2: m3u8: Fix memory leak
Clear the GValue holding intermediate GstStructure field
data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Edward Hervey 6934362817 hlsdemux2: Always check DSN if required
We don't want to consider the candidate as being before the playlist if the DSN
don't match

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:27 +01:00
Edward Hervey c20ad629c7 hlsdemux2: Allow DSN mismatches when re-syncing playlists
Some providers provide completely incompatible DSN across bitrates/renditions,
but do keep MSN consistent.

If we fail to synchronize playlist with DSN, retry without the DSN taken into
account.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:12 +01:00
Jan Schmidt b2944c36ca hlsdemux2: Fix memory leaks
Clean up various memory leaks

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
2022-06-29 14:33:30 +00:00
Edward Hervey 34a7710762 hlsdemux2: Fix debug return statement
Due to latest commits res could have been NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:24 +00:00
Edward Hervey 82bd65e711 hlsdemux2: No longer re-add segments from before the playlist
When updating playlists, there is a possibility that the playlists don't
perfectly align, but the last entry of the previous playlist is *just* before
the first entry of the new playlist.

In those cases, we still can transfer the timing information from one playlist
to another, but we do not want to return that segment as being the matching one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 87ab729551 hlsdemux2: Detect synchronization loss
If we have been updating too slowly and have gone out of the current live
window, inform the baseclass accordingly.

This is different from the case where we have been updating quicker than what
the server provides.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 8fd2dcd266 hlsdemux2: Add a new method to synchronize two media playlist
This allows transfering the stream time of the playlist to an updated
variant/rendition.

This allows updating that information without having a "current segment"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Piotr Brzeziński 0a2c490723 adaptivedemux2: Prevent duplicate symbols on static builds
Uses prelude header files with #defines to rename DASH and MSS
symbols duplicated in their old standalone versions.
Also redefines soup-related functions when building it for
adaptivedemux2 to prevent symbol conflicts there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2534>
2022-06-15 01:13:16 +00:00
Seungha Yang 238ce301b6 hlsdemux2: Adjust debug log level
HLS manifest might not be represented by a single common caps
when different codecs are mixed in a playlist, but it
does not seem to be a critical issue we need to warn.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2516>
2022-06-01 14:32:55 +00:00
Edward Hervey 964ee0299d hls/m3u8: Fix starting segment for live playlist
RFC 8216 6.3.3 "Playing the Media Playlist File" : states that for live media
playlists "the client SHOULD NOT choose a segment that starts less than three
target durations from the end of the Playlist file"

This is an off-by-one error. Since we are looking for the "index" of the
segment, we need to subtract 1 from the searched position.

Ex: For a playlist with 12 entries, we want to start playback on the 9th segment
... which is at index 8.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2259>
2022-04-22 08:06:27 +00:00
Edward Hervey af78c16dd5 New HLS, DASH and MSS adaptive demuxer elements
This provides new HLS, DASH and MSS adaptive demuxer elements as a single plugin.

These elements offer many improvements over the legacy elements. They will only
work within a streams-aware context (`urisourcebin`, `uridecodebin3`,
`decodebin3`, `playbin3`, ...).

Stream selection and buffering is handled internally, this allows them to
directly manage the elementary streams and stream selection.

Authors:
* Edward Hervey <edward@centricular.com>
* Jan Schmidt <jan@centricular.com>
* Piotrek Brzeziński <piotr@centricular.com>
* Tim-Philipp Müller <tim@centricular.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2117>
2022-04-18 14:11:23 +00:00