hlsdemux2: Fix playlist reload interval when unchanged
When falling back to using the regular last segment, use that duration as the identical-playlist reload interval (and not the playlist target duration which could be much larger) Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
parent
5935c8049a
commit
6684aee14c
@ -404,8 +404,6 @@ get_playlist_reload_interval (GstHLSDemuxPlaylistLoader * pl,
|
|||||||
GstM3U8MediaSegment *last_seg =
|
GstM3U8MediaSegment *last_seg =
|
||||||
g_ptr_array_index (playlist->segments, playlist->segments->len - 1);
|
g_ptr_array_index (playlist->segments, playlist->segments->len - 1);
|
||||||
|
|
||||||
target_duration = last_seg->duration;
|
|
||||||
|
|
||||||
if (priv->llhls_enabled && last_seg->partial_segments) {
|
if (priv->llhls_enabled && last_seg->partial_segments) {
|
||||||
GstM3U8PartialSegment *last_part =
|
GstM3U8PartialSegment *last_part =
|
||||||
g_ptr_array_index (last_seg->partial_segments,
|
g_ptr_array_index (last_seg->partial_segments,
|
||||||
@ -417,6 +415,9 @@ get_playlist_reload_interval (GstHLSDemuxPlaylistLoader * pl,
|
|||||||
} else {
|
} else {
|
||||||
min_reload_interval = target_duration / 2;
|
min_reload_interval = target_duration / 2;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
target_duration = last_seg->duration;
|
||||||
|
min_reload_interval = target_duration / 2;
|
||||||
}
|
}
|
||||||
} else if (priv->llhls_enabled
|
} else if (priv->llhls_enabled
|
||||||
&& GST_CLOCK_TIME_IS_VALID (playlist->partial_targetduration)) {
|
&& GST_CLOCK_TIME_IS_VALID (playlist->partial_targetduration)) {
|
||||||
@ -428,10 +429,15 @@ get_playlist_reload_interval (GstHLSDemuxPlaylistLoader * pl,
|
|||||||
|
|
||||||
if (playlist->reloaded && target_duration > min_reload_interval) {
|
if (playlist->reloaded && target_duration > min_reload_interval) {
|
||||||
GST_DEBUG_OBJECT (pl,
|
GST_DEBUG_OBJECT (pl,
|
||||||
"Playlist didn't change previously, returning lower update interval");
|
"Playlist didn't change previously, returning lower update interval (%"
|
||||||
|
GST_TIME_FORMAT " -> %" GST_TIME_FORMAT ")",
|
||||||
|
GST_TIME_ARGS (target_duration), GST_TIME_ARGS (min_reload_interval));
|
||||||
target_duration = min_reload_interval;
|
target_duration = min_reload_interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (pl, "Returning target duration %" GST_TIME_FORMAT,
|
||||||
|
GST_TIME_ARGS (target_duration));
|
||||||
|
|
||||||
return target_duration;
|
return target_duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user