diff options
author | wm4 <wm4@nowhere> | 2020-02-14 16:07:13 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-02-14 16:07:13 +0100 |
commit | c59ca06a0fff432ac4cae012bb0299a8db9a00d3 (patch) | |
tree | e50b04c632b29a8498b5cdf0206ea567423b965f /sub/draw_bmp.c | |
parent | 777c046b358e9e1b82f574875698e650722c0f5e (diff) | |
download | mpv-c59ca06a0fff432ac4cae012bb0299a8db9a00d3.tar.bz2 mpv-c59ca06a0fff432ac4cae012bb0299a8db9a00d3.tar.xz |
stream_file: cache file size
Some cache logic in demux.c queries the raw byte stream size on every
packet read. This is because it reports the value to the user. (It has
to be polled like this because there is no change notification in most
underlying I/O APIs, and also the user can't just block on the demuxer
thread to update it explicitly.)
This causes a very high number of get_size calls with low packet sizes,
so cache the size, and update it on every read. Reads only happen
approximately all 64KB read with default settings, which is way less
frequent than every packet in such extreme cases.
In theory, this could in theory cause problems in some cases. Actually
this is whole commit complete non-sense, because why micro-optimize for
broken cases like patent troll codecs. I don't need to justify it
anyway.
As a minor detail, off_t is actually specified as signed, so the off_t
cast is never needed.
Diffstat (limited to 'sub/draw_bmp.c')
0 files changed, 0 insertions, 0 deletions