[vlc-commits] hls: Fixing bad length computing.
Chris Smowton
git at videolan.org
Mon Mar 5 19:21:22 CET 2012
vlc/vlc-2.0 | branch: master | Chris Smowton <chris at smowton.net> | Sun Mar 4 22:17:33 2012 +0100| [e9bbfae40f5cb705efa24cb6adf9d6877acb1bc7] | committer: Jean-Baptiste Kempf
hls: Fixing bad length computing.
Signed-off-by: Hugo Beauzée-Luyssen <beauze.h at gmail.com>
(cherry picked from commit d0590ad182d82c5c856b8b4555bce93d5ccc1fb6)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=e9bbfae40f5cb705efa24cb6adf9d6877acb1bc7
---
modules/stream_filter/httplive.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 0bfed93..7e8c558 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -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 */
More information about the vlc-commits
mailing list