Commit 0ef7876b authored by Frédéric Yhuel's avatar Frédéric Yhuel Committed by Jean-Baptiste Kempf

HLS: don't use floats when not necessary

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c2841b22
...@@ -1494,12 +1494,7 @@ static int hls_DownloadSegmentData(stream_t *s, hls_stream_t *hls, segment_t *se ...@@ -1494,12 +1494,7 @@ static int hls_DownloadSegmentData(stream_t *s, hls_stream_t *hls, segment_t *se
msg_Info(s, "downloaded segment %d from stream %d", msg_Info(s, "downloaded segment %d from stream %d",
segment->sequence, *cur_stream); segment->sequence, *cur_stream);
/* check for division by zero */ uint64_t bw = segment->size * 8 * 1000000 / __MAX(1, duration); /* bits / s */
double ms = (double)duration / 1000.0; /* ms */
if (ms <= 0.0)
return VLC_SUCCESS;
uint64_t bw = ((double)(segment->size * 8) / ms) * 1000; /* bits / s */
p_sys->bandwidth = bw; p_sys->bandwidth = bw;
if (p_sys->b_meta && (hls->bandwidth != bw)) if (p_sys->b_meta && (hls->bandwidth != bw))
{ {
......
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