Commit 1f33a25e authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

hls: Trying to work arround streams without bandwidth value.

A 0 bandwidth forbid us to seek, as the position would always be 0.
This fixes one of the problems described in #5370
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 56a345ef
...@@ -1558,6 +1558,11 @@ static int hls_DownloadSegmentData(stream_t *s, hls_stream_t *hls, segment_t *se ...@@ -1558,6 +1558,11 @@ static int hls_DownloadSegmentData(stream_t *s, hls_stream_t *hls, segment_t *se
return VLC_EGENERIC; return VLC_EGENERIC;
} }
mtime_t duration = mdate() - start; mtime_t duration = mdate() - start;
if (hls->bandwidth == 0)
{
/* Try to estimate the bandwidth for this stream */
hls->bandwidth = (uint64_t)((double)segment->size / ((double)duration / 1000000.0));
}
/* If the segment is encrypted, decode it */ /* If the segment is encrypted, decode it */
if (hls_DecodeSegmentData(s, hls, segment) != VLC_SUCCESS) if (hls_DecodeSegmentData(s, hls, segment) != VLC_SUCCESS)
......
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