Commit 30296dca authored by Jean-Paul Saman's avatar Jean-Paul Saman

stream_filter/httplive.c: b_cache determined in wrong place

The logic to determine if caching of segments is allowed or denied was flawed. It
only determined it onces after the playlists were loaded. In case of a meta playlist
the logic would only indicated the caching value for the last added HLS stream.

The fix is to determine p_sys->b_caching (caching segments allowed or not) when switching
segments or HLS streams (adaptive bandwidth).
parent 5af85ce4
......@@ -815,10 +815,6 @@ static int parse_HTTPLiveStreaming(stream_t *s)
/* Stream size (approximate) */
hls->size = hls_GetStreamSize(hls);
}
/* Can we cache files after playback */
p_sys->b_cache = hls->b_cache;
vlc_mutex_unlock(&hls->lock);
}
......@@ -1394,6 +1390,7 @@ static segment_t *GetSegment(stream_t *s)
/* This segment is ready? */
if (segment->data != NULL)
{
p_sys->b_cache = hls->b_cache;
vlc_mutex_unlock(&hls->lock);
return segment;
}
......@@ -1428,6 +1425,7 @@ static segment_t *GetSegment(stream_t *s)
(p_sys->playback.segment < i_segment))
{
p_sys->playback.current = i_stream;
p_sys->b_cache = hls->b_cache;
vlc_mutex_unlock(&hls->lock);
return segment;
}
......
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