Commit ac3f6195 authored by Ilkka Ollakka's avatar 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.
parent 29fdcac6
...@@ -1443,8 +1443,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t * ...@@ -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); vlc_array_append(hls_old->segments, p);
msg_Dbg(s, "- segment %d appended", p->sequence); msg_Dbg(s, "- segment %d appended", p->sequence);
hls_old->max_segment_length = __MAX(hls_old->max_segment_length, l->duration); hls_old->max_segment_length = __MAX(hls_old->max_segment_length, p->duration);
msg_Dbg(s, " playlists new max duration %d", hls_old->max_segment_length); msg_Dbg(s, " - segments new max duration %d", hls_old->max_segment_length);
// Signal download thread otherwise the segment will not get downloaded // Signal download thread otherwise the segment will not get downloaded
*stream_appended = true; *stream_appended = true;
......
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