In case of live streams, the reload thread did not wake up the download thread and so new segments were not downloaded. Problem was fixed by sginalling the download thread with the condition variable.

Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
Bug fix: HLS module does not block until data is available. As a result live streams may end unexpectedly in case of short playlists or slow connections. Problem was fixed by blocking on a condition variable in the "read" function in case data is not available until Download thread signals (when new data is available) or a timeout of 10 seconds is reached. Blocking is done with a timed wait in order to avoid deadlocks since the thread that calls read is also responsible for calling close.

Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
httplive: cosmetic
httplive: check segment gap on last segment number instead of the segment number of last playlist load
httplive: don't reload playlist all the time.

Reload playlist only when there is only 1 or 0 segments left that are
downloaded but not played yet. Also change the default interval to be
segment length instead of half segment length.

With this patch it downloads 3 segments from 5 seglen playlist at the
time and then plays those. Should be much nicer on http-server and
powersaving (marginally as there isn't network activity that often).
httplive: downgrade most of the messages from Info to Debug
httplive: cosmetic retab