| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
| |
MPlayer requires numeric values for input command parameters. mplayer2
also did. mpv changed these to choices using symbolic strings a long
time ago, but left numeric choices for compatibility.
|
| |
|
|
|
|
| |
This is for the case if the FD is a uni-directional pipe.
|
| |
|
|
|
|
|
| |
This requires fchmod(), which is not necessarily available everywhere.
It also might not work at all. (It does work on Linux.)
|
|
|
|
|
|
|
| |
Add MP_KEY_MOUSE_ENTER to the ignored input if the user has disabled
mouse input. Remove one instance of code duplication, and add a
MP_KEY_IS_MOUSE_MOVE macro to summarize events that are caused by moving
the mouse.
|
|
|
|
| |
Signed-off-by: wm4 <wm4@nowhere>
|
|
|
|
|
|
|
|
|
| |
Requested.
Hopefully will be useful for things that download and add external
subtitles on demand. Or something.
Closes #1586.
|
|
|
|
|
| |
Some IR receivers emit this key by default for remote control
buttons. Make it mappable.
|
|
|
|
|
|
|
|
| |
Makes all keys documented in XF86keysym.h mappable. This requires the
user to deal with numeric keycodes; no names are queried or exported.
This is an easy way to avoid adding all the hundreds of XF86 keys to
our X11 lookup table and mpv's keycode/name list.
|
|
|
|
|
|
|
| |
Happens to fix #1581 due to an unfortunate interaction with the way the
VO does not react to commands for a while if a video frame is queued.
Slightly improves other situations as well, if the client spams mpv with
commands during playback.
|
|
|
|
|
|
|
|
| |
These commands are counterparts of sub_add/sub_remove/sub_reload which
work for external audio file.
Signed-off-by: wm4 <wm4@nowhere>
(minor simplification)
|
|
|
|
| |
Removes undefined behavior that showed up as crap when running with -v.
|
|
|
|
|
|
|
| |
New command `mouse <x> <y> [<button> [single|double]]` is introduced.
This will update mouse position with given coordinate (`<x>`, `<y>`),
and additionally, send single-click or double-click event if `<button>`
is given.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closing the video window sends CLOSE_WIN, which is normally mapped to
the "quit" command. The client API normally disables all key bindings,
and closing the window does nothing. It's simply left to the application
to handle this. This is fine - an embedded window can not be destroyed
by user interaction.
But sometimes, the window might be destroyed anyway, for example because
the containing window is destroyed. If this happens, CLOSE_WIN should
better not be ignored. We can't expect client API users to handle this
specially (by providing their own input.conf), so provide some fallback
for this pseudo key binding. The "quit" command might be too intrusive
(not every client necessarily handles "unexpected" MPV_EVENT_SHUTDOWN),
but I think it's still reasonable.
|
|
|
|
| |
This was requested.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the IPC with a program, it's not often obvious that a newline must
be sent to terminate a command. Print a warning if the connection is
closed while there is still uninterpreted data in the buffer.
Print the OS reported error if reading/writing the socket fails. Print
an erro if JSON parsing fails.
I considered silencing write errors if the write end is closed (EPIPE),
because a client might send a bunch of commands, and then close the
socket without wanting to read the reply. But then, mpv disconnects
without reading further commands that might still be buffered, so it's
probably a good idea to always print the error.
|
|
|
|
|
| |
"revert_seek mark" basically forces the seekback point. It's basically a
one-way bookmark.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this commit, this was defined to trigger undefined behavior. This
was nice because it required less code; but on the other hand, Lua as
well as IPC support had to check these things manually. Do it directly
in the API to avoid code duplication, and to make the API more robust.
(The total code size still grows, though...)
Since all of the failure cases were originally meant to ruin things
forever, there is no way to return error codes. So just print the
errors.
|
|
|
|
|
| |
This fixes a hang with the VirtualBox OpenGL drivers. It might help
with #1325 as well.
|
|
|
|
|
|
|
|
|
|
| |
If the user has LEFT/RIGHT/etc. bound in his input.conf, then these were
overriding the menu keys in dvdnav mode.
This hack works because the dvdnav crap happens to be the only user of
MP_INPUT_ON_TOP. If it finds a default key binding in the dvdnav menu
section, it will use that, instead of continuing search and possibly
finding the user key bindings meant for normal playback.
|
|
|
|
|
|
| |
This just kept adding bindings to the input section, rather than
defining it. One bad effect was that mp.remove_key_binding() in Lua
didn't work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
...because everything is terrible.
strerror() is not documented as having to be thread-safe by POSIX and
C11. (Which is pretty much bullshit, because both mandate threads and
some form of thread-local storage - so there's no excuse why
implementation couldn't implement this in a thread-safe way. Especially
with C11 this is ridiculous, because there is no way to use threads and
convert error numbers to strings at the same time!)
Since we heavily use threads now, we should avoid unsafe functions like
strerror().
strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and
gives the function different semantics than the POSIX one. It's a bit of
work to convince this piece of shit to expose the POSIX standard
function, and not the messed up GNU one.
strerror_l() is also in POSIX, but only since the 2008 standard, and
thus is not widespread.
The solution is using avlibc (libavutil, by its official name), which
handles the unportable details for us, mostly. We avoid some pain.
|
| |
|
|
|
|
|
|
| |
Simpler, and leaves the decision to repeat or not fully to the script
(instead of requiring the user to care about it when remapping a script
binding).
|
|
|
|
|
|
| |
MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated.
Also remove a debug-print from defaults.lua.
|
|
|
|
|
| |
If repeated framestep commands are sent, just unpause the player, instead
of playing N frames for N repeated commands.
|
|
|
|
|
| |
Much of it is the same, but now there's the possibility to distinguish
key down/up events in the Lua API.
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, mouse button bindings added by mp.add_key_binding() would be
ignored.
It's possible that this "breaks" some older scripts using undocumented
Lua script functions, but it should be safe otherwise.
Fixes #1283.
|
|
|
|
| |
Found by Coverity; also see commit 85fb2af3.
|
|
|
|
| |
Found by Coverity.
|
|
|
|
|
|
| |
The fact that it's a generic command prefix that is parsed even when
using the client API is a bit unclean (because this flag makes sense
for actual key-bindings only), but it's less code this way.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This command was actually requested on IRC ages ago, but I forgot about
it.
The main purpose is that the decoding state can be reset without issuing
a seek, in particular in situations where you can't seek.
This restarts decoding from the middle of the packet stream; since it
discards the packet buffer intentionally, and the decoder will typically
not output "incomplete" frames until it has recovered, it can skip a
large amount of data.
It doesn't clear the byte stream cache - I'm not sure if it should.
|
|
|
|
|
|
| |
As suggested in #1241; to make using the feature easier.
Also add better OSD-formatting for the ab-loop-a/b properties.
|
|
|
|
| |
It's not necessarily available on Unix systems other than Linux (sigh).
|
|
|
|
|
| |
The receiving part was implemented, but since no messages are enabled
by default, it couldn't be used.
|
| |
|
|
|
|
|
| |
Calling mpv_resume() too often is considered an API usage violation,
and will trigger an internal assertion somewhere.
|
|
|
|
|
|
|
| |
This change is probably too simplistic, but most things appear to work,
so I don't care about that now.
Fixes #1232.
|
|
|
|
|
| |
If there are several input.confs in the set of valid config paths, load
them all.
|
|
|
|
|
| |
Anticipated use: simple solution for dealing with audio APIs which
request configuration changes via events.
|
|
|
|
| |
Because why not.
|
|
|
|
| |
It was a bit ugly/annoying.
|
| |
|
|
|
|
|
| |
This avoids reloading a subtitle if it was already added. In all cases,
the subtitle is selected.
|
|
|
|
| |
This was always intended. Also fixes subtitle-file drag & drop.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Especially with other components (libavcodec, OSX stuff), the thread
list can get quite populated. Setting the thread name helps when
debugging.
Since this is not portable, we check the OS variants in waf configure.
old-configure just gets a special-case for glibc, since doing a full
check here would probably be a waste of effort.
|
| |
|