mirror of https://github.com/mpv-player/mpv
5bea966836
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. |
||
---|---|---|
.. | ||
ai_alsa1x.c | ||
ai_oss.c | ||
ai_sndio.c | ||
audio_in.c | ||
audio_in.h | ||
cache.c | ||
cache_file.c | ||
cookies.c | ||
cookies.h | ||
discnav.h | ||
dvb_tune.c | ||
dvb_tune.h | ||
dvbin.h | ||
frequencies.c | ||
frequencies.h | ||
rar.c | ||
rar.h | ||
stream.c | ||
stream.h | ||
stream_avdevice.c | ||
stream_bluray.c | ||
stream_cdda.c | ||
stream_dvb.c | ||
stream_dvd.c | ||
stream_dvd_common.c | ||
stream_dvd_common.h | ||
stream_dvdnav.c | ||
stream_edl.c | ||
stream_file.c | ||
stream_lavf.c | ||
stream_memory.c | ||
stream_mf.c | ||
stream_null.c | ||
stream_pvr.c | ||
stream_rar.c | ||
stream_smb.c | ||
stream_tv.c | ||
tv.c | ||
tv.h | ||
tvi_def.h | ||
tvi_dummy.c | ||
tvi_v4l2.c |