mpv/player
wm4 f26dfb6e4d player: partially rework --cache-pause
The --cache-pause feature (enabled by default) will pause playback for a
while if network runs out of data. If this is not done, then playback
will go on frame-wise (as packets are slowly read from the network and
then instantly decoded and displayed). This feature is actually useless,
as you won't get nice playback no matter what if network is too slow,
but I guess I still prefer this behavior for some reason.

This commit changes this behavior from using the demuxer cache state
only, to trying to use underrun information from the AO/VO. This means
if you have a very large audio buffer, then cache-pausing will trigger
once that buffer is depleted, which will be some time _after_ the
demuxer cache has run out.

This requires explicit support from the AO. Otherwise, the behavior
should be mostly the same as before this commit.

This does not care about the AO buffer. In theory, the AO may underrun,
then the player will write some data to the AO buffer, then the AO will
recover and play this bit of data, then the player will probably trigger
the cache-pause behavior. The probability of this happening should be
pretty low, so I will hold off fixing this until the next refactor of
the AO chain (if ever).

The VO underflow detection was devised and tested in 5 minutes, and may
not be correct. At least I'm fairly sure that the combination of all the
factors should make incorrect behavior relatively unlikely, but problems
are possible.

Also, the demux_reader_state.underrun field may be inaccurate. It's only
the present state at the time demux_get_reader_state() was called, and
may exclude past underruns. In theory, this could cause "close" cases to
be missed. Then you might get an audio underrun without cache-pausing
acting on it. If the stars align, this could happen multiple times in
the row, effectively making this feature not work.

The most user-visible consequence of this change is that the user
will now see an AO underrun warning every time the cache runs out.

Maybe this cache-pause feature should just be removed...
2019-10-11 20:01:51 +02:00
..
javascript js: expose mpv_abort_async_command() (match dbe831bd) 2019-09-11 21:08:04 +03:00
lua player: update for --video-aspect deprecation 2019-10-04 22:41:31 +02:00
audio.c player: partially rework --cache-pause 2019-10-11 20:01:51 +02:00
client.c client API: add mpv_command_ret 2019-09-21 14:24:42 +02:00
client.h render api: fix use-after-free 2019-09-20 13:54:17 +02:00
command.c options: rename --video-aspect to --video-aspect-override 2019-10-04 21:34:22 +02:00
command.h demux, command: add a third stream recording mechanism 2019-09-19 20:37:05 +02:00
configfiles.c player: update for --video-aspect deprecation 2019-10-04 22:41:31 +02:00
core.h player: partially rework --cache-pause 2019-10-11 20:01:51 +02:00
external_files.c external_files: add .lrc subtitle extension 2019-09-02 01:25:43 +03:00
external_files.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
javascript.c js: expose mpv_abort_async_command() (match dbe831bd) 2019-09-11 21:08:04 +03:00
loadfile.c player: don't load external files when reading from stdin 2019-10-06 21:35:15 +02:00
lua.c lua: expose mpv_abort_async_command() 2018-05-24 19:56:34 +02:00
main.c player: "subprocess" command should stop immediately in idle mode 2019-10-04 16:30:48 +02:00
misc.c player: fix --loop with backward playback 2019-09-19 20:37:05 +02:00
osd.c player: format low cache duration with more decimals 2019-10-11 19:18:43 +02:00
playloop.c player: partially rework --cache-pause 2019-10-11 20:01:51 +02:00
screenshot.c screenshot: move message showing to common code 2019-09-19 20:37:05 +02:00
screenshot.h image_writer: move convert_image() to player/screenshot.c 2019-09-14 23:02:39 +02:00
scripting.c scripting: change when/how player waits for scripts being loaded 2018-04-18 01:17:41 +03:00
sub.c player: ensure backward playback state is propagated on track switching 2019-09-19 20:37:05 +02:00
video.c player: partially rework --cache-pause 2019-10-11 20:01:51 +02:00