mpv/stream
wm4 5bea966836 cache: limit readahead size to half the cache size at the beginning
Normally, the cache keeps 50% of the buffer for seeking backwards. Until
now, the cache just used the full buffer size at the beginning of a
file, because the 50% normally reserved for the backbuffer are unused.

This caused a problem: when streaming from http, the player would first
read about 150MB (default cache size), then stop until 75MB of the cache
has been played. (Until the 75MB position, the cache is fully used, so
nothing new can be read. After that, part of the backbuffer starts
getting unreserved, and can be used for readahead.) This long read pause
can cause the server to terminate the connection. Reconnecting may be
possible, but if youtube-dl is used, the media URL may have become
invalid.

Fix this by limiting readahead to 50% even if unnecessary. The only
exception is when the whole file would fit in the cache. In this case,
it won't matter if we can't reconnect, because the cache covers
everything anyway, and hopefully the cache will stay valid.

Likely fixes #2000.
2015-05-29 22:32:10 +02:00
..
ai_alsa1x.c Update license headers 2015-04-13 12:10:01 +02:00
ai_oss.c Update license headers 2015-04-13 12:10:01 +02:00
ai_sndio.c audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00
audio_in.c Update license headers 2015-04-13 12:10:01 +02:00
audio_in.h Update license headers 2015-04-13 12:10:01 +02:00
cache.c cache: limit readahead size to half the cache size at the beginning 2015-05-29 22:32:10 +02:00
cache_file.c cache_file: refuse to cache unseekable streams 2014-09-29 18:06:44 +02:00
cookies.c Update license headers 2015-04-13 12:10:01 +02:00
cookies.h Update license headers 2015-04-13 12:10:01 +02:00
discnav.h command: disc-mouse-on-button property 2015-04-21 00:54:29 +09:00
dvb_tune.c dvb_tune: fix invalid syntax 2015-02-11 11:36:14 +01:00
dvb_tune.h stream_dvb: Also demux PMT if possible, reactivate TPID parsing. 2015-01-06 19:52:27 +01:00
dvbin.h stream_dvb: Always define NO_STREAM_ID_FILTER if missing. 2015-02-28 18:27:21 +01:00
frequencies.c Update license headers 2015-04-13 12:10:01 +02:00
frequencies.h Update license headers 2015-04-13 12:10:01 +02:00
rar.c stream: remove stream filter concept 2015-02-27 19:51:14 +01:00
rar.h
stream.c vo_opengl: add support for custom shaders 2015-05-27 11:09:41 +02:00
stream.h vo_opengl: add support for custom shaders 2015-05-27 11:09:41 +02:00
stream_avdevice.c Update license headers 2015-04-13 12:10:01 +02:00
stream_bluray.c Remove trailing whitespaces 2015-05-15 11:02:44 +02:00
stream_cdda.c Update license headers 2015-04-13 12:10:01 +02:00
stream_dvb.c options: add M_OPT_FILE to new options that are missing it 2015-03-07 22:19:38 +01:00
stream_dvd.c Update license headers 2015-04-13 12:10:01 +02:00
stream_dvd_common.c Update license headers 2015-04-13 12:10:01 +02:00
stream_dvd_common.h Update license headers 2015-04-13 12:10:01 +02:00
stream_dvdnav.c path: make mp_path_join accept normal C strings 2015-05-09 15:26:47 +02:00
stream_edl.c stream: always disable cache for pseudo-streams 2014-12-24 14:33:34 +01:00
stream_file.c stream_file: minor simplification 2015-04-17 23:04:11 +02:00
stream_lavf.c Update license headers 2015-04-13 12:10:01 +02:00
stream_memory.c
stream_mf.c Update license headers 2015-04-13 12:10:01 +02:00
stream_null.c Update license headers 2015-04-13 12:10:01 +02:00
stream_pvr.c Update license headers 2015-04-13 12:10:01 +02:00
stream_rar.c stream_rar: update comment 2015-03-29 13:37:14 +02:00
stream_smb.c Update license headers 2015-04-13 12:10:01 +02:00
stream_tv.c Update license headers 2015-04-13 12:10:01 +02:00
tv.c Update license headers 2015-04-13 12:10:01 +02:00
tv.h Update license headers 2015-04-13 12:10:01 +02:00
tvi_def.h Update license headers 2015-04-13 12:10:01 +02:00
tvi_dummy.c Update license headers 2015-04-13 12:10:01 +02:00
tvi_v4l2.c Update license headers 2015-04-13 12:10:01 +02:00