From 9bcb9fcf2652afce86c53b353d63cc3377862eab Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 1 Apr 2017 20:45:20 +0200 Subject: player: make screenshot commands honor the async flag And also change input.conf to make all screenshots async. (Except the every-frame mode, which always uses synchronous mode and ignores the flag.) By default, the "screenshot" command is still asynchronous, because scripts etc. might depend on this behavior. This is only partially async. The code for determining the filename is still always run synchronously. Only encoding the screenshot and writing it to disk is asynchronous. We explicitly document the exact behavior as undefined, so it can be changed any time. Some of this is a bit messy, because I wanted to avoid duplicating the message display code between sync and async mode. In async mode, this is called from a worker thread, which is not safe because showing a message accesses the thread-unsafe OSD code. So the core has to be locked during this, which implies accessing the core and all that. So the code has weird locking calls, and we need to do core destruction in a more "controlled" manner (thus the outstanding_async field). (What I'd really want would be the OSD simply showing log messages instead.) This is pretty untested, so expect bugs. Fixes #4250. --- DOCS/man/input.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'DOCS') diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index babfd1aacd..4135b499ef 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -186,6 +186,12 @@ List of Input Commands second argument (and did not have flags). This syntax is still understood, but deprecated and might be removed in the future. + Setting the ``async`` flag will make encoding and writing the actual image + file asynchronous in most cases. (``each-frame`` mode ignores this flag + currently.) Requesting async screenshots too early or too often could lead + to the same filenames being chosen, and overwriting each others in undefined + order. + ``screenshot-to-file "" [subtitles|video|window]`` Take a screenshot and save it to a given file. The format of the file will be guessed by the extension (and ``--screenshot-format`` is ignored - the @@ -198,6 +204,9 @@ List of Input Commands Like all input command parameters, the filename is subject to property expansion as described in `Property Expansion`_. + The ``async`` flag has an effect on this command (see ``screenshot`` + command). + ``playlist-next [weak|force]`` Go to the next entry on the playlist. -- cgit v1.2.3