summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-06-07 14:40:20 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:05 +0200
commit5d6b7c39abab4fc4dd7d5fb11af6439715064c98 (patch)
tree5e761e9d9f99be3edcebee5a433dd01060ebdb9f /player/loadfile.c
parentb45c17e5a91476bf8a7293343fca3c8dc4761481 (diff)
downloadmpv-5d6b7c39abab4fc4dd7d5fb11af6439715064c98.tar.bz2
mpv-5d6b7c39abab4fc4dd7d5fb11af6439715064c98.tar.xz
demux: handle accounting for index size differently
The demuxer cache tries to track the number of bytes allocated for the cache. In addition to the packet queue, the seek index is another data structure that roughly depends on the amount of packets cached. So the index size should somehow be part of the total number of bytes tracking. Until now, this was handled with KF_SEEK_ENTRY_WORST_CASE, basically a shitty heuristic. It was a guess (and probably rather an upper bound than a lower bound). The implementation details made it annoying, and it was conceptually inaccurate too. Change this, and instead simply add the index size to the total cache size. This essentially makes it part of the backbuffer. It's nice that this cleanly decouples it from the packet size tracking itself. Since it's part of the backbuffer number of bytes now, packet pruning can't necessarily free enough space in the backbuffer anymore. Before this commit, the backbuffer consisted of packets only, so it was possible to reduce its size to 0 by pruning all packets until the decoder reader position, at which point a packet was accounted as forward buffered. Now the index is added to this, and it can't be pruned. Replace the assert() because of this changed invariant.
Diffstat (limited to 'player/loadfile.c')
0 files changed, 0 insertions, 0 deletions