1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-19 09:57:34 +00:00
mpv/DOCS/man
wm4 c5eb2f2ac4 f_decoder_wrapper: make decoder thread responsive while filling queue
The mp_filter_run() invocation blocks as long as the demuxer provides
packets and the queue can be filled. That means it may block quite a
long time of the decoder queue size is large (since we use libavcodec in
a blocking manner; it regrettably does not have an async. API).

This made the main thread freeze in certain situations, because it has
to wait on the decoder thread.

Other than I suspected (I wrote that code, but that doesn't mean I know
how the hell it works), this did not freeze during seeking: seek resets
flushed the queue, which also prevented the decoder thread from adding
more frames to it, thus stopping decoding and responding to the main
thread in time. But it does fix the issue that exiting the player waited
for the decoder to finish filling the queue when stopping playback.
(This happened because it called mp_decoder_wrapper_set_play_dir()
before any resets. Related to the somewhat messy way play_dir is
generally set. But it affects all "synchronous" decoder wrapper API
calls.)

This uses pretty weird mechanisms in filter.h and dispatch.h. The
resulting durr hurr interactions are probably hard to follow, and this
whole thing is a sin. On the other hand, this is a _very_ user visible
issue, and I'm happy that it can be fixed in such an unintrusive way.
2020-03-05 22:00:50 +01:00
..
af.rst audio: remove unreferenced af_lavrresample 2019-09-19 20:37:05 +02:00
ao.rst ao_pulse: add --pulse-allow-suspended 2019-09-21 12:54:36 +02:00
changes.rst manpage: directly link interface-changes.rst in changelog section 2020-02-21 14:34:02 +01:00
console.rst console: use hidpi scale reporting 2019-12-20 13:00:39 +01:00
encode.rst manpage: explain deprecated usage of multiple items with *-add 2020-01-07 18:13:12 +01:00
input.rst manpage: clarify writes to playlist-pos 2020-03-05 22:00:50 +01:00
ipc.rst ipc: allow sending commands with named arguments 2020-02-24 00:31:46 +01:00
javascript.rst DOCS: js: minor update for require 2020-02-07 19:24:00 +02:00
libmpv.rst
lua.rst manpage: improve command_native_async description 2020-02-16 23:03:14 +01:00
mpv.rst manpage: fix some path description details 2020-02-21 12:13:54 +01:00
options.rst f_decoder_wrapper: make decoder thread responsive while filling queue 2020-03-05 22:00:50 +01:00
osc.rst osc: use default hr-seek when dragging progress bar to seek 2020-02-28 17:17:42 +01:00
stats.rst manpage: document stats page 3 2019-10-31 11:06:22 +01:00
vf.rst vf_format: add w, h parameters 2020-02-09 18:23:22 +01:00
vo.rst sws_utils, zimg: destroy vo_x11 and vo_drm performance 2019-10-31 16:51:12 +01:00