aboutsummaryrefslogtreecommitdiffhomepage
path: root/input/ipc.c
Commit message (Collapse)AuthorAge
* ipc: add enable_event and disable_event commandsGravatar wm42014-12-24
| | | | This was requested.
* ipc: report some user errors betterGravatar wm42014-12-24
| | | | | | | | | | | | | | | 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.
* client API: be more lenient about mpv_suspend/resume mismatchesGravatar wm42014-12-15
| | | | | | | | | | | | 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.
* lua, ipc: remove leftoversGravatar wm42014-11-24
| | | | | | MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated. Also remove a debug-print from defaults.lua.
* ipc: fix confusion of write() return value and errnoGravatar wm42014-11-21
| | | | Found by Coverity.
* ipc: make sure --input-file=/dev/stdin always worksGravatar wm42014-11-07
| | | | It's not necessarily available on Unix systems other than Linux (sigh).
* ipc: make it possible to receive log messagesGravatar wm42014-11-01
| | | | | The receiving part was implemented, but since no messages are enabled by default, it couldn't be used.
* ipc: add a command to retrieve API versionGravatar wm42014-11-01
|
* ipc: verify resume/suspend commandsGravatar wm42014-11-01
| | | | | Calling mpv_resume() too often is considered an API usage violation, and will trigger an internal assertion somewhere.
* input: resolve ~ and similar for --input-fileGravatar wm42014-10-24
| | | | Because why not.
* Set thread name for debuggingGravatar wm42014-10-19
| | | | | | | | | | 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.
* ipc: skip empty and commented linesGravatar wm42014-10-19
|
* ipc: accept both JSON and "old" commandsGravatar wm42014-10-19
| | | | Minimizes the differences between --input-file and --input-unix-socket.
* ipc: fix minor error cleanup issuesGravatar wm42014-10-19
| | | | | | | | | | | | | | The ipc_thread can exit any time, and will free the mp_ipc_ctx when doing this, leaving a dangling pointer. This was somewhat handled in the original commit by setting mpctx->ipc_ctx to NULL when the thread exited, but that was still a race condition. Handle it by freeing most things after joining the ipc_thread. This means some resources will not be freed until player exit, but that should be ok (it's an exceptional error situation). Also, actually close the pipe FDs in mp_init_ipc() on another error path.
* ipc: decouple from MPContextGravatar wm42014-10-19
| | | | Just a minor refactor to keep unneeded dependencies on the core low.
* ipc: fix a small memory leakGravatar wm42014-10-17
|
* input: implement --input-file on unix using the IPC supportGravatar Alessandro Ghedini2014-10-17
|
* input: implement JSON-based IPC protocolGravatar Alessandro Ghedini2014-10-17