[vlc-commits] httplive: cache around 10 sec worth of segments instead of just 2
Ilkka Ollakka
git at videolan.org
Fri Aug 16 15:01:17 CEST 2013
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Aug 5 19:30:32 2013 +0300| [37c8d257a4d8f1a7987b742e80e469eaa39d02ac] | committer: Ilkka Ollakka
httplive: cache around 10 sec worth of segments instead of just 2
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=37c8d257a4d8f1a7987b742e80e469eaa39d02ac
---
modules/stream_filter/httplive.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 08aa9cf..62f1a2a 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -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 )
More information about the vlc-commits
mailing list