Commit d0590ad1 authored by Chris Smowton's avatar Chris Smowton Committed by Hugo Beauzée-Luyssen

hls: Fixing bad length computing.

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent 0307c51e
......@@ -1458,10 +1458,10 @@ static int hls_DownloadSegmentData(stream_t *s, hls_stream_t *hls, segment_t *se
return VLC_EGENERIC;
}
mtime_t duration = mdate() - start;
if (hls->bandwidth == 0)
if (hls->bandwidth == 0 && segment->duration > 0)
{
/* Try to estimate the bandwidth for this stream */
hls->bandwidth = (uint64_t)((double)segment->size / ((double)duration / 1000000.0));
hls->bandwidth = (uint64_t)(((double)segment->size * 8) / ((double)segment->duration));
}
/* If the segment is encrypted, decode it */
......
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