]> git.sesse.net Git - vlc/commitdiff
httplive: use correct segment to calculate duration
authorIlkka Ollakka <ileoo@videolan.org>
Tue, 4 Feb 2014 07:51:11 +0000 (09:51 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 4 Feb 2014 07:52:31 +0000 (09:52 +0200)
Fixes off-by-one segment duration uses, and actually use
new segments length to see how long segments are and when
the playlist should be reloaded.

modules/stream_filter/httplive.c

index 725a538cfe42a3d2665e71189b599124ae5783d1..f9ce835d6b476ae9c2a17b348ef02dec43e98b9f 100644 (file)
@@ -1443,8 +1443,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
             }
             vlc_array_append(hls_old->segments, p);
             msg_Dbg(s, "- segment %d appended", p->sequence);
-            hls_old->max_segment_length = __MAX(hls_old->max_segment_length, l->duration);
-            msg_Dbg(s, " playlists new max duration %d", hls_old->max_segment_length);
+            hls_old->max_segment_length = __MAX(hls_old->max_segment_length, p->duration);
+            msg_Dbg(s, "  - segments new max duration %d", hls_old->max_segment_length);
 
             // Signal download thread otherwise the segment will not get downloaded
             *stream_appended = true;