Commit 37c8d257 authored by Ilkka Ollakka's avatar Ilkka Ollakka

httplive: cache around 10 sec worth of segments instead of just 2

parent f6d867eb
......@@ -1727,8 +1727,9 @@ static int Prefetch(stream_t *s, int *current)
else if (vlc_array_count(hls->segments) == 1 && p_sys->b_live)
msg_Warn(s, "Only 1 segment available to prefetch in live stream; may stall");
/* Download first 2 segments of this HLS stream if they exist */
for (int i = 0; i < __MIN(vlc_array_count(hls->segments), 2); i++)
/* Download ~10s worth of segments of this HLS stream if they exist */
unsigned segment_amount = (0.5f + 10/hls->duration);
for (int i = 0; i < __MIN(vlc_array_count(hls->segments), segment_amount); i++)
{
segment_t *segment = segment_GetSegment(hls, p_sys->download.segment);
if (segment == NULL )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment