[vlc-commits] httplive: use correct segment to calculate duration

Ilkka Ollakka git at videolan.org
Tue Feb 4 08:53:07 CET 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Tue Feb  4 09:51:11 2014 +0200| [ac3f61953b25a61cf46c16badcfd2a24f890b83e] | committer: Ilkka Ollakka

httplive: use correct segment to calculate duration

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ac3f61953b25a61cf46c16badcfd2a24f890b83e
---

 modules/stream_filter/httplive.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 725a538..f9ce835 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -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;



More information about the vlc-commits mailing list