summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* win32: change config path prioritieswm42014-10-232-2/+31
| | | | | | | | | | | | | | | | | Assume mpv.exe is located in $mpv_exe_dir, then config files were preferably loaded from "$mpv_exe_dir/mpv". This was mostly traditional, and inherited from MPlayer times. Reverse the config path priority order, and prefer $CSIDL_APPDATA/mpv as main config path. This also fixes behavior when writing watch_later configs, and mpv is installed in a not-writable path. It's possible that this will cause regressions for some users, if the change in preference suddenly prefers stale config files (which may happen to longer around in the appdata config dir) over the user's proper config. Also explicitly document the behavior.
* rename ao_coreaudio_device.c -> ao_coreaudio_exclusive.cStefano Pigozzi2014-10-232-1/+1
| | | | This is so that the source file name matches the AO name
* reflect recent coreaudio changes in the manualStefano Pigozzi2014-10-231-11/+4
|
* coreaudio: redirect IEC61937 to coreaudio_exclusiveStefano Pigozzi2014-10-232-1/+7
|
* audio/out: add redirection-on-init mechanismwm42014-10-222-14/+47
| | | | | Looks like this will help us with making --audio-device and spdif work as expected on OSX. To be used ina following commit.
* audio/out: missing error checkwm42014-10-221-0/+2
| | | | Oops.
* audio/out: don't add special devices to --audio-device listwm42014-10-221-2/+2
| | | | | | | | | | | | | | | | | | Since the list associated with --audio-device is supposed to enable simple user-selection, it doesn't make much sense to include overly special things like ao_pcm or ao_null in the list. Specifically, ao_pcm is harmful, because it will just dump all audio to a file named audiodump.wav in the current working directory. The user can't choose the filename (it can be customized, but not through this option), and the working directory might be essentially random, especially if this is used from a GUI. Exclude "strange" entries. We reuse the fact that there's already a simple list ordered by auto-probe priority in order to avoid having to add an additional flag. This is also why coreaudio_exclusive was moved above ao_null: ao_null ends auto-probing and marks the start of "special" outputs, which don't show up on the device, but we want coreaudio_exclusive to be selectable (I think).
* audio/out: include coreaudio_exclusive in auto-probingwm42014-10-221-3/+3
| | | | | | | Move it above ao_null, so that it can be selected during auto-probing (even if it's only last). I see no reason why it should not be included, and it makes the following commit slightly more elegant. (See explanations there.)
* player: show busy symbol on OSD if seeking takes too longwm42014-10-221-2/+7
| | | | Same as it's done on the terminal.
* command: make trailing sub_add actually optionalwm42014-10-221-1/+2
| | | | This was always intended. Also fixes subtitle-file drag & drop.
* lua: don't let temporary values take the place of argumentswm42014-10-221-1/+13
| | | | | | | Because Lua is so terrible, it's easy to confuse temporary values pushed to the Lua stack with arguments if the arguments are checked after that. Add a hack that should fix this.
* osdep: NetBSD pthread_setname_np()wm42014-10-223-1/+15
| | | | | | From: bugmen0t on github Fixes #1207.
* command: make reverse cycle_values match up with forward onewm42014-10-212-5/+4
| | | | | | | | | The behavior of reverse cycling (with the "!reverse" magic value) was a bit weird and acted with a "delay". This was because the command set the value the _next_ command should use. Change this and make each command invocation select and use the next command directly. This requires an "uninitialized" special index in the counter, but that is no problem at all.
* command: fix video-rotate update when pausedwm42014-10-211-11/+11
| | | | | | | | | | | Due to the way video-rotate currently works, the state will be automatically updated once new video is decoded. So the filter chain doesn't need to be reinitialized automatically, but there is a need to trigger the video instant refresh code path instead. Also move the support function closer to an annoying similar yet different function. They probably can be unified next time major changes are done to this code.
* lua: don't use "output" as identifierwm42014-10-211-4/+4
| | | | | I suspect this clashes with libcs,w hich define "stdout" as macro. Hopefully fixes #1206.
* command: add cursor-autohide propertywm42014-10-212-0/+18
| | | | | | | | | | | Allows properly changing/updating the cursor state. Useful for client API window embedding, because the host application may not want the mpv window to grab mouse input, and this has to manually handle the cursor. Changing the cursor of foreign windows is usually not sane. It might make sense to allow changing the cursor icon, but that would be much more complicated, so I won't add it unless someone actually requests it.
* command: add playback-abort propertywm42014-10-212-0/+13
| | | | Now this is obscure.
* command: add video-rotate propertywm42014-10-212-0/+15
|
* options: allow selecting track ID 0 toowm42014-10-211-1/+1
| | | | Blergh. Now needed for --ff-aid and friends.
* player: add stream selection by ffmpeg indexwm42014-10-219-11/+77
| | | | | | | | | Apparently using the stream index is the best way to refer to the same streams across multiple FFmpeg-using programs, even if the stream index itself is rarely meaningful in any way. For Matroska, there are some possible problems, depending how FFmpeg actually adds streams. Normally they seem to match though.
* sd_lavc: strictly letter-box PGS subtitleswm42014-10-213-4/+9
| | | | | | | | | | | | | | Getting subtitle scaling and positioning right even if there are video filters, which completely change the image (like cropping), doesn't seem to have a single, correct solution. To some degree, the results are arbitrary, so we may as well do what is most useful to the user. In this case, if the PGS resolution aspect ratio and the video output aspect ratio mismatch, letter-box it, instead of stretching the subs over the video frame. (This will require additional fixes, should it turn out that there are PGS subtitles which are stretched by design.) Fixes #1205.
* json: handle >\\"< fragments correctlywm42014-10-211-2/+3
| | | | | | It assumed that any >\"< sequence was an escape for >"<, but that is not the case with JSON such as >{"ducks":"\\"}<. In this case, the second >\< is obviously not starting an escape.
* TOOLS/lua: update README.mdKevin Mitchell2014-10-211-9/+2
|
* TOOLS/lua: remove tabs from some lua scriptsKevin Mitchell2014-10-213-50/+50
|
* TOOLS/lua: add autodeint.luaKevin Mitchell2014-10-211-0/+164
| | | | | | | This isn't quite as robust as idet.sh as the default detection interval is only 4 seconds vs 35 for idet.sh. idet.sh can have such a large sample time since it turns off the vo and uses --untimed, which is currently not possible from lua.
* command: add field-dominance propertyKevin Mitchell2014-10-212-0/+4
|
* lua: add convenience function for hookswm42014-10-212-0/+47
| | | | So the user doesn't have to care about the awkward low-level details.
* command: extend sub_add commandwm42014-10-213-4/+30
|
* command: remove hook cancellation mechanismwm42014-10-203-15/+3
| | | | | I doubt anyone will actually use this correctly. Also, there was a bug (a typo) which prevented it from working at all.
* command: allow sub_add at an earlier stagewm42014-10-201-1/+1
|
* osdep: shorten thread name on glibc onlywm42014-10-201-3/+7
| | | | | Instead of affecting every platform, do this for glibc only (where it's known to be a problem), and only if the right error is returned.
* manpage: fix a typoBen Boeckel2014-10-201-1/+1
|
* osdep: limit thread names to 16 characterswm42014-10-202-2/+2
| | | | | | | | | | | | | | | | It turns out the glibc people are very clever and return an error if the thread name exceeds the maximum supported kernel length, instead of truncating the name. So everyone has to hardcode the currently allowed Linux kernel name length limit, even if it gets extended later. Also the Lua script filenames could get too long; use the client name instead. Another strange thing is that on Linux, unrelated threads "inherit" the name by the thread they were created. This leads to random thread names, because there's not necessarily a strong relation between these threads (e.g. script command leads to filter recreation -> the filter's threads are tagged with the script's thread name). Unfortunate.
* stream: stupid compilation workaround for win32wm42014-10-191-1/+1
| | | | | | | | On win32, open() is a function-like macro. The line of code changed with this commit accidentally expanded the macro. Prevent this macro expansion. Not sure why that happened now. Since as far as I remember system functions can be defined as macros, this affects in theory not only win32.
* Set thread name for debuggingwm42014-10-1917-0/+73
| | | | | | | | | | 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.
* manpage: ipc: mention unavailability on Windowswm42014-10-191-1/+3
| | | | | | Windows doesn't have unix domain sockets, and can't handle sockets and pipes in an uniform way. Only the libwaio fallback code is available, which doesn't do JSON.
* player: shutdown all clients before actual uninitwm42014-10-191-2/+2
| | | | | This seems safer. It might be possible that commands sent by the clients could recreate e.g. audio or video outputs.
* manpage: ipc: mention the socat toolwm42014-10-191-1/+2
| | | | | | | | This is not realy obvious, so I assume this is a helpful hint. Although the usefulness of such an approach is probably influenced by the fact that the player might send events that arrive in the short window while the socket is connected.
* ipc: skip empty and commented lineswm42014-10-192-3/+9
|
* ipc: accept both JSON and "old" commandswm42014-10-193-31/+38
| | | | Minimizes the differences between --input-file and --input-unix-socket.
* ipc: fix minor error cleanup issueswm42014-10-191-8/+8
| | | | | | | | | | | | | | 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 MPContextwm42014-10-194-52/+54
| | | | Just a minor refactor to keep unneeded dependencies on the core low.
* audio: quote devices in --audio-device=helpwm42014-10-192-2/+4
| | | | | The output is a bit confusing. Quoting the device name probably helps a little bit; also add minimal explanations to the manpage.
* fix build on OS X and BSDStefano Pigozzi2014-10-192-2/+4
|
* Merge pull request #1195 from kevmitch/luafixChrisK22014-10-191-1/+3
|\ | | | | lua: fix lua_objlen -> lua_rawlen for lua 5.2
| * lua: fix lua_objlen -> lua_rawlen for lua 5.2Kevin Mitchell2014-10-181-1/+3
|/
* lua: strictly free memory on errorswm42014-10-193-30/+32
| | | | | | | Thanks to the recently introduced mp_lua_PITA(), this is "simple" now. It fixes leaks on Lua errors. The hack to avoid stack overflows manually isn't needed anymore, and the Lua error handler will take care of this.
* lua: expose JSON parserwm42014-10-194-0/+46
| | | | | | | The JSON parser was introduced for the IPC protocol, but I guess it's useful here too. The motivation for this commit is the same as with 8e4fa5fc (again).
* lua: add an utility function for starting processeswm42014-10-196-9/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because 1) Lua is terrible, and 2) popen() is terrible. Unfortunately, since Unix is also terrible, this turned out more complicated than I hoped. As a consequence and to avoid that this code has to be maintained forever, add a disclaimer that any function in Lua's utils module can disappear any time. The complexity seems a bit ridiculous, especially for a feature so far removed from actual video playback, so if it turns out that we don't really need this function, it will be dropped again. The motivation for this commit is the same as with 8e4fa5fc. Note that there is an "#ifndef __GLIBC__". The GNU people are very special people and thought it'd be convenient to actually declare "environ", even though the POSIX people, which are also very special people, state that no header declares this and that the user has to declare this manually. Since the GNU people overtook the Unix world with their very clever "embrace, extend, extinguish" strategy, but not 100%, and trying to build without _GNU_SOURCE is hopeless; but since there might be Unix environments which support _GNU_SOURCE features partially, this means that in practice "environ" will be randomly declared or not declared by system headers. Also, gcc was written by very clever people too, and prints a warning if an external variable is declared twice (I didn't check, but I suppose redeclaring is legal C, and not even the gcc people are clever enough to only warn against a definitely not legal C construct, although sometimes they do this), ...and since we at mpv hate compiler warnings, we seek to silence them all. Adding a configure test just for a warning seems too radical, so we special-case this against __GLIBC__, which is hopefully not defined on other libcs, especially not libcs which don't implement all aspects of _GNU_SOURCE, and redefine "environ" on systems even if the headers define it already (because they support _GNU_SOURCE - as I mentioned before, the clever GNU people wrote software THAT portable that other libcs just gave up and implemented parts of _GNU_SOURCE, although probably not all), which means that compiling mpv will print a warning about "environ" being redefined, but at least this won't happen on my system, so all is fine. However, should someone complain about this warning, I will force whoever complained about this warning to read this ENTIRE commit message, and if possible, will also force them to eat a printed-out copy of the GNU Manifesto, and if that is not enough, maybe this person could even be forced to convince the very clever POSIX people of not doing crap like this: having the user to manually declare somewhat central symbols - but I doubt it's possible, because the POSIX people are too far gone and only care about maintaining compatibility with old versions of AIX and HP-UX. Oh, also, this code contains some subtle and obvious issues, but writing about this is not fun.
* command: add "estimated-vf-fps" change notifcationwm42014-10-191-1/+2
|
* lua: add a helper to auto-free temporary C memorywm42014-10-191-6/+32
| | | | | | | | | | | | | | | | | Using the Lua API is a big PITA because it uses longjmp() error handling. That is, a Lua API function could any time raise an error and longjmp() to a lower part of the stack. This kind of "exception handling" is completely foreign to C, and there are no proper ways to clean up the "skipped" stack frames. Other than avoiding such situations entirely, the only way to deal with this is using Lua "userdata", which is basically a malloc'ed data block managed by the Lua GC, and which can have a destructor function associated (__gc metamethod). This requires an awful lot of code (because the Lua API is just so terrible), so I avoided this utnil now. But it looks like this will make some of the following commits much easier, so here we go.
* win32: remove an unneeded mechanismwm42014-10-192-7/+3
| | | | | Instead of relying on the macro-defined lseek(), just use _lseeki64 directly, and avoid a minor mess.
* win32: remove outdated commentwm42014-10-191-3/+0
|
* cocoa: reintroduce async resizeStefano Pigozzi2014-10-187-9/+71
| | | | | | | After removing synchronous libdispatch calls, this looks like it doesn't deadlock anymore. I also experimented with pthread_mutex_trylock liek wm4 suggested, but it leads to some annoying black flickering. I will fallback to that only if some new deadlocks are discovered.
* Revert "cocoa: perform init and uninit synchronously"Stefano Pigozzi2014-10-181-1/+3
| | | | This reverts commit a0ac8b6331d345748d415cf71affbe7a90e336a6.
* manpage: ipc: explain security implicationswm42014-10-171-0/+8
| | | | | | It's kind of obvious, since the protocol by design has to allow you to read (loadfile) and write (screenshot_to) random files, but better make it explicit so that nobody accidentally does something insecure.
* DOCS/client_api_examples: qtexample: don't require Qt 5.xwm42014-10-171-0/+7
| | | | Exclude the worthless Qt 5.0-only demo code on Qt 4.x.
* ipc: fix a small memory leakwm42014-10-171-1/+2
|
* win32: clear window handle on destructionwm42014-10-171-0/+1
| | | | | | As I understand, otherwise, the code will try to destroy the same window again in the cleanup part of the gui_thread(), which makes no sense and is potentially dangerous.
* win32: get rid of mp_stat in the normal source codewm42014-10-176-12/+59
| | | | | | | | | | | mp_stat() instead of stat() was used in the normal code (i.e. even on Unix), because MinGW-w64 has an unbelievable macro-mess in place, which prevents solving this elegantly. Add some dirty workarounds to hide mp_stat() from the normal code properly. This now requires replacing all functions that use the struct stat type. This includes fstat, lstat, fstatat, and possibly others. (mpv currently uses stat and fstat only.)
* win32: make lseek() fail on pipeswm42014-10-172-0/+19
| | | | | | On MingGW seeking on pipes succeeds. This fix is quite similar to Gnulib's (lib/lseek.c).
* old-build: adjust to latest changeswm42014-10-171-1/+2
|
* input: implement --input-file on unix using the IPC supportAlessandro Ghedini2014-10-176-77/+62
|
* manpage: add JSON IPC documentationAlessandro Ghedini2014-10-175-3/+148
|
* input: implement JSON-based IPC protocolAlessandro Ghedini2014-10-176-0/+743
|
* misc: add JSON parserwm42014-10-172-0/+309
|
* cocoa: allow mouse events to bubble up with no-input-cursorStefano Pigozzi2014-10-174-24/+115
| | | | | Previously we didn't report events to the core, but still prevented the events to travel on the responder chain.
* cocoa: allow to disable apple remote at compile timeStefano Pigozzi2014-10-173-1/+15
| | | | | Actually doesn't remove the related flags so that one can still pass the option with the option doing nothing.
* demux: print a warning if stream is not seekablewm42014-10-171-2/+3
|
* options: don't load per-file config files by defaultwm4