mpv/demux
wm4 871a8a316a demux: avoid queue overflow warning when joining two ranges
If the backbuffer is much larger than the forward buffer, and if you
join a small range with a large range (larger than the forward buffer),
then the seek issues to the end of the range after joining will overflow
the queue.

Normally, read_more will be false when the forward buffer is full, but
the resume seek after joining will set need_refresh to true, which
forces more reading and thus triggers the overfloe warning.

Attempt to fix this by not setting read_more to true on refresh seeks.
Set prefetch_more instead. read_more will still be set if an A/V stream
has no data.

This doesn't help with the following problems related to using refresh
seeks for track switching:

- If the forward buffer is full, then enabling another track will
  obviously immediately overflow the queue, and immediately lead to
  marking the new track as having no more data (i.e. EOF). We could cut
  down the forward buffer or so, but there's no simple way to implement
  it. Another possibility would be dropping all buffers and trying to
  resume again, but this would likely be complex as well.
- Subtitle tracks will not even show a warning (because they are sparse,
  and we have no way of telling whether a packet is missing, or there's
  just no packet near the current position). Before this commit,
  enabling an empty subtitle track would probably have overflown the
  queue, because ds->refreshing was never set to true. Possibly this
  could be solved by determining a demuxer read position, which would
  reflect until which PTS all subtitle packets should have been demuxed.

The forward buffer limit was intended as a last safeguard to avoid
excessive memory usage against badly interleaved files or decoders going
crazy (up to reading the whole into memory and OOM'ing the user's
system). It's not good at all to limit prefetch. Possibly solutions
include having another smaller limit for prefetch, or maybe having only
a total buffer limit, and discarding back buffer if more data has to be
read. The current solution is making the forward buffer larger than the
forward duration (--cache-secs) would require, but of course this
depends on the stream's bitrate.
2017-11-11 06:23:50 +01:00
..
codec_tags.c
codec_tags.h
cue.c
cue.h
demux.c demux: avoid queue overflow warning when joining two ranges 2017-11-11 06:23:50 +01:00
demux.h demux: export demuxer cache sizes in bytes 2017-11-10 16:43:18 +01:00
demux_cue.c
demux_disc.c demux_disc: fix bluray subtitle language retrieval 2017-07-16 19:02:35 +02:00
demux_edl.c
demux_lavf.c Bump libav* API use 2017-10-30 20:55:42 +01:00
demux_libarchive.c
demux_mf.c build: switch preliminary LGPL mode from v3 to v2.1 2017-10-05 15:57:30 +02:00
demux_mkv.c demux_mkv: fix potential uninitialized variable read 2017-11-10 12:49:53 +01:00
demux_mkv_timeline.c
demux_null.c
demux_playlist.c win32: add more-POSIXy versions of open() and fstat() 2017-10-25 22:37:20 +11:00
demux_rar.c
demux_raw.c
demux_timeline.c demux_timeline: don't use segments for DASH 2017-10-26 00:38:20 +02:00
demux_tv.c
ebml.c demux_mkv: rewrite packet reading to avoid 1 memcpy() 2017-11-05 18:13:34 +01:00
ebml.h demux_mkv: rewrite packet reading to avoid 1 memcpy() 2017-11-05 18:13:34 +01:00
matroska.h
packet.c demux_mkv: rewrite packet reading to avoid 1 memcpy() 2017-11-05 18:13:34 +01:00
packet.h demux_mkv: rewrite packet reading to avoid 1 memcpy() 2017-11-05 18:13:34 +01:00
stheader.h demux: improvements to previous commits 2017-10-20 22:30:59 +02:00
timeline.c
timeline.h