mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
m3u8demux2: Fix off-by-one and leak.
Fix an off-by-one in gst_hls_media_playlist_sync_to_playlist() that would ignore the first fragment in the reference playlist. The error was harmless, since we expect the reference playlist to be older than the playlist we're synchronising (so the first/oldest segment in the reference playlist will likely not exist in the new playlist), so this is just for correctness. Also fix a segment leak in gst_hls_media_playlist_advance_fragment() when ignoring the partial_only segment. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
parent
676fffd23c
commit
9848c1a1a1
1 changed files with 3 additions and 2 deletions
|
@ -1830,8 +1830,8 @@ retry_without_dsn:
|
||||||
* or a more recently fetched playlist from another rendition. In either case,
|
* or a more recently fetched playlist from another rendition. In either case,
|
||||||
* it's best to start from the last segment of the (older) reference playlist and
|
* it's best to start from the last segment of the (older) reference playlist and
|
||||||
* go backwards to find an overlap */
|
* go backwards to find an overlap */
|
||||||
for (idx = reference->segments->len - 1; idx; idx--) {
|
for (idx = reference->segments->len; idx; idx--) {
|
||||||
cand = g_ptr_array_index (reference->segments, idx);
|
cand = g_ptr_array_index (reference->segments, idx - 1);
|
||||||
res = find_segment_in_playlist (playlist, cand, &is_before, &matched_pdt);
|
res = find_segment_in_playlist (playlist, cand, &is_before, &matched_pdt);
|
||||||
if (res)
|
if (res)
|
||||||
break;
|
break;
|
||||||
|
@ -1957,6 +1957,7 @@ gst_hls_media_playlist_advance_fragment (GstHLSMediaPlaylist * m3u8,
|
||||||
if (file && file->partial_only && !allow_partial_only_segment) {
|
if (file && file->partial_only && !allow_partial_only_segment) {
|
||||||
GST_LOG
|
GST_LOG
|
||||||
("Ignoring segment with only partials as full segment was requested");
|
("Ignoring segment with only partials as full segment was requested");
|
||||||
|
gst_m3u8_media_segment_unref (file);
|
||||||
file = NULL;
|
file = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue