summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* input.conf: add default keybindings for sub-scalesoredake2020-10-272-2/+5
|
* console: let type set the cursor positionGuido Cella2020-10-272-6/+18
| | | | | | | | | | | | | | | | | | This allows keybindings such as: a script-message-to console type "seek :0 absolute" 6 % script-message-to console type "seek absolute-percent" 6 The cursor position 0 isn't allowed because it has the weird effect of filling the console with the text twice, leaving the cursor in the middle. Negative positions would put the cursor n characters before the end, and positions greater than the text's length at the end. They seem to work at first, but the console breaks when you move the cursor, so they aren't allowed. It seems that float values don't cause issues, but I'm using the argument's floor anyway to be safe. Using >= 1 instead of > 0 ignores values like 0.5.
* ytdl_hook: if ytdl not found in config dirs, use ytdl_path as isRicardo Constantino2020-10-271-1/+4
|
* ytdl_hook: support alternative youtube-dl pathRicardo Constantino2020-10-272-2/+9
| | | | | Allows using a youtube-dl not in PATH or a compatible fork of youtube-dl.
* player: reorder list of external cover files for optimal resultssfan52020-10-251-7/+9
|
* build: disable wayland if linux/input-event-codes.h isn’t availableEmmanuel Gil Peyrot2020-10-251-1/+5
| | | | | | | | | | | | | The wl_pointer interface defines button argument as “a button code as defined in the Linux kernel's linux/input-event-codes.h header file, e.g. BTN_LEFT.” We could #define these few buttons ourselves, but there is no system to test it on, so for now let’s disable Wayland support on them. This is a call to non-Linux system maintainers, please help test this backend on your system and report issues you find, or even working state.
* wayland: use more specific input codes headerEmmanuel Gil Peyrot2020-10-251-1/+1
| | | | | | Wayland’s wl_pointer interface describes the button event’s argument as being taken from linux/input-event-codes.h, so there is no need to include the more generic linux/input.h.
* demux_lavf: initialize ReplayGain dataMia Herkt2020-10-231-0/+2
| | | | | | | This was causing undefined behavior when playing streams without RG tags but with RG enabled. Broken in 585f9ff42f3195c. Thanks to uau for bisecting.
* command: add delete-watch-later-configVladimir Panteleev2020-10-225-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces the delete-watch-later-config command, to complement write-watch-later-config. This is an alternative to #8141. The general problem that this change is attempting to help solve has been described in #336, #3169 and #6574. Though persistent playback position of a single file is generally a solved problem, this is not the case for playlists, as described in #8138. The motivation is facilitating intermittent playback of very large playlists, consisting of hundreds of entries each many hours long. Though the current "watch later" mechanism works well - provided that the files each occur only once in that playlist, and are played only via that playlist - the biggest issue is that the position is lost completely should mpv exit uncleanly (e.g. due to a power failure). Existing workarounds (in the form of Lua scripts which call write-watch-later-config periodically) fail in the playlist case, due to the mechanism used by mpv to determine where within a playlist to resume playback from. The missing puzzle piece needed to allow scripts to implement a complete solution to this problem is simply a way to clean up the watch-later configuration that the script asked mpv to write using write-watch-later-config. With that in place, scripts can then register an end-file event listener, check the stop playback reason, and in the "eof" and "stop" case, invoke delete-watch-later-config to delete any saved positions written by write-watch-later-config. The script can then proceed to immediately write a new one when the next file is loaded, which altogether allows mpv to resume from the correct playlist and file position upon next startup. Because events are delivered and executed asynchronously, delete-watch-later-config takes an optional filename argument, to allow scripts to clear watch-later configuration for files after mpv had already moved on from playing them and proceeded to another file. A Lua script which makes use of this change can be found here: https://gist.github.com/CyberShadow/2f71a97fb85ed42146f6d9f522bc34ef (A modification of the one written by @Hakkin, in that this one takes advantage of the new command, and also saves the state immediately when a new file is loaded.)
* vo_gpu: improve gamut warning bounds checksNiklas Haas2020-10-211-2/+2
| | | | | | | Test for signals exceeding 0.5% of the permitted gamut, in either direction. (Before, it was 1% above and 0% below) Should fix https://github.com/mpv-player/mpv/issues/8161
* wayland: don't use presentation time if ust is 0Dudemanguy2020-10-191-3/+4
| | | | | | | | Testing kwinft out (kwin fork), it was discovered that sometimes it would return a ust value of 0 which subsequently resulted in incorrect presentation statistics (i.e. large negative numbers which are obviously impossible). Arguably, it shouldn't return 0s, but a workaround for mpv in this case is harmless.
* stats: display hw pixel format toosfan52020-10-161-0/+4
|
* command: expose underlying pixfmt for hwdecsfan52020-10-162-0/+7
|
* ci/appveyor: attempt to work around outdated msys2Jan Ekström2020-10-171-0/+8
| | | | | | | | Based on the workarounds utilized in the MAME project: 1. mamedev/mame@4b4016110a71a5b84b9d19faf20238d20926088d 2. mamedev/mame@2d1bf3ed5cb1f4cdcc40b286a78c24f398217535 Co-authored-by: James Ross-Gowan <rossy@jrg.systems>
* ci/travis: stop installing mingw-w64 packages manuallyJan Ekström2020-10-161-4/+0
| | | | | | As we are now on 20.04, these packages are now available in the repositories. Additionally, they don't need to be separately pulled in, as gcc-mingw-w64 already does that.
* ci/travis: move to a yaml list for required packages for mingw-w64Jan Ekström2020-10-161-2/+8
|
* ci/travis: bump Ubuntu distro version to focal (20.04)Jan Ekström2020-10-161-1/+1
|
* manpage: Document behaviour of *nix configuration directoriesPhilip Langdale2020-10-161-6/+22
| | | | | | | The original documentation here is unclear, so let's describe the behaviour we actually have. Inspired by wm4's updated docs but obviously not identical because we're not changing any of the behaviours.
* Revert "path: switch back to using non-XDG config dir by default"Philip Langdale2020-10-162-48/+30
| | | | This reverts commit 269f0e743e5634691f0c9d5b1b8a4bb68eedbbd0.
* Revert "path: do not use old_home for win32 exe dir"Philip Langdale2020-10-163-4/+1
| | | | This reverts commit c3694f0acb7f71daac7606fafbadcb7b500ca35e.
* Revert "manpage: reference standard for configuration file location"Philip Langdale2020-10-161-5/+0
| | | | This reverts commit 67b4a96e4592a6bf95a86ebcc8f6c5e951fe327d.
* build: bump waf to 2.0.20Jan Ekström2020-10-161-2/+2
| | | | | | There have been mentions that there are apparently some bugs with regards to possible random build failures, so bumping after a few years sounds like an OK thing to test/do.
* stream_lavf: enable SRT protocol support through FFmpegAlexandre Iooss2020-10-153-2/+3
| | | | | Additionally, announce support for the protocol in Mac and Linux application metadata.
* vo_gpu: fix segfault when updating render optsDudemanguy2020-10-151-1/+2
| | | | | | VOCTRL_UPDATE_RENDER_OPTS is supposed to be optional so check if it actually exists before executing the function. Fixes a segfault when changing the alpha value at runtime on non-wayland platforms.
* vo_gpu: EGL: hack for alpha on different platformsDudemanguy2020-10-152-1/+4
| | | | | | | | | | | 7fb972f fixed transparency on x11/EGL/Mesa but happened to also break it for wayland and nvidia. Ideally on wayland, you should just be able to pick the right EGLConfig that has alpha but this doesn't seem to work because reasons. So just go back to setting the EGL_ALPHA_SIZE bit if the user asks for alpha. Apparently this worked before for nvidia as well. The hack is to just run an eglQueryString in the x11egl context. If it picks up Mesa as the EGL_VENDOR, then force ctx->opts.want_alpha to 0 and let pick_xrgba_config take care of the rest.
* wayland: update opaque region on runtimeDudemanguy2020-10-155-39/+54
| | | | | | | | | | Made possible with 00b9c81. 34b8adc let the wayland surface set an opaque region depending on if alpha was set by the user or not. However, there was no attempted detection for runtime changes and it is possible (at least in wayland vulkan) to toggle the alpha on and off. So this meant, we could be incorrectly signalling an opaque region if the user happened to change the alpha. Additionally, add a helper function for this and use it everywhere we want to set the opaque region.
* vo_gpu: update render options on runtimeDudemanguy2020-10-152-4/+14
| | | | | | | | | | | | vo_gpu has a small set of options for ra_ctx that can be set. In practice, runtime toggling doesn't matter for most of these as they have no effect while a video is playing. However, changing the alpha option during runtime can actually work depending on the backend used. mpv already detected when one of these options changed, but it made no attempt to update the options in the ra_ctx accordingly (likely because nothing made any use of this information). Another related change is to add an update_render_opts to the fns and allow invidiual backends to (optionally) use it.
* wayland: be less strict about when to renderDudemanguy2020-10-155-3/+16
| | | | | | | | | | | | | | | | | | | | | efb0c5c changed the rendering logic of mpv on wayland and made it skip rendering when it did not receive frame callback in time. The idea was to skip rendering when the surface was hidden and be less wasteful. This unfortunately had issues in certain instances where a frame callback could be missed (but the window was still in view) due to imprecise rendering (like the default audio video-sync mode). This would lead to the video appearing to stutter since mpv would skip rendering in those cases. To account for this case, simply re-add an old heuristic for detecting if a window is hidden or not since the goal is to simply not render when a window is hidden. If the wait on the frame callback times out enough times in a row, then we consider the window hidden and thus begin to skip rendering then. The actual threshold to consider a surface as hidden is completely arbitrary (greater than your monitor's refresh rate), but it's safe enough since realistically you're not going to miss 60+ frame callbacks in a row unless the surface actually is hidden. Fixes #8169.
* wscript_build.py: use -Wl,--subsystem,console insteadChristopher Degawa2020-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes an issue with clang not using the -mconsole option if mwindows is present resulting in mpv.com being a gui program instead of a console program. Does not interfere with gcc compilation. result without this patch ``` file .\mpv.com .\mpv.exe .\mpv.com: PE32+ executable (GUI) x86-64 (stripped to external PDB) .\mpv.exe: PE32+ executable (GUI) x86-64 (stripped to external PDB) ``` both executables open the mpv gui with out console output. result with this patch ``` file .\mpv.com .\mpv.exe .\mpv.com: PE32+ executable (console) x86-64 (stripped to external PDB) .\mpv.exe: PE32+ executable (GUI) x86-64 (stripped to external PDB) ``` mpv.com properly outputs text to console instead of instantly opening a gui `, for MS Windows` removed from the end of file outputs to reduce col count https://github.com/m-ab-s/media-autobuild_suite/issues/1794 Signed-off-by: Christopher Degawa <ccom@randomderp.com>
* docs: fix simple typo, unminimze -> unminimizeTim Gates2020-10-141-1/+1
| | | | | | There is a small typo in DOCS/man/options.rst. Closes #8165
* DOCS: fix typo on sub-filter-regex-enableChris Varenhorst2020-10-121-1/+1
|
* manpage: reference standard for configuration file locationwm42020-10-091-0/+5
|
* Revert "demux: add a POS"wm42020-10-084-190/+0
| | | | | | This reverts commit 4f18e7927bacd2e887f8cca48a967804ce7adf86. It was a mistake, and barely anyone needs this.
* player: fix another nightmarish corner casewm42020-10-081-3/+14
| | | | Pretty much fuck this shit.
* demux: add a POSwm42020-10-084-0/+190
| | | | | | I regret doing this so much, it's fucking garbage. Fixes: #5100
* Revert "wayland: add wayland-display-socket option"Dudemanguy2020-10-073-17/+3
| | | | | | | Pointless feature that can be done with environment variables. It was also implemented incorrectly and broke autoprobing. This reverts commit 015b6768759c8bd8cc815be01123ef95c192f3c5.
* wayland: add wayland-display-socket optionDudemanguy2020-10-063-3/+17
| | | | | | | | | | As per the client API, a client can connect to any arbitrary wayland socket. mpv has always just passed NULL which connected to the compositor currently in use, but one could just as easily pass the name of a different socket (i.e. the value of WAYLAND_DISPLAY). Here, we just expose this argument as a user configurable option. If the user passes a socket name that does not exist, then print a warning and fall back to NULL.
* screenshot: add --screenshot-sw optionwm42020-10-054-1/+19
| | | | | Probably worthless. As usual, the manpage dumps all the subtle differences due to implementation details on the user.
* wayland: set an opaque regionDudemanguy2020-10-013-0/+19
| | | | | | | | | Apparently a part of the wayland spec. A compositor may use a surface that has set part of itself as opaque for various optimizations. For mpv, we simply set the entire surface as opaque as long as the user has not set alpha=yes (note: alpha is technically broken in the wayland EGL backend at the time of this commit but oh well). wlshm is always opaque. Fixes #8125.
* options: fix --cover-art-file typoGuido Cella2020-09-301-1/+1
| | | | ...which makes it not work.
* player: cosmetically change around some codewm42020-09-281-9/+9
| | | | Is this better?
* player: add automatic loading of external cover art fileswm42020-09-286-8/+95
| | | | | | | | | | | | | | | | | | | | | | | Picks up files like "cover.jpg". It's made part of normal external file loading, so I'm adding 3 new options that are direct equivalents for the options that control loading of external subtitle and audio files. Even though I bet nobody wants them and they just increase confusion... I guess the world is actually hell, so this outcome should be fine. It prefers non-specific external files like "cover.jpg" over embedded cover art. Not sure if that's wanted or unwanted. There's some pain over explicitly marking such files as external pictures. This is basically an optimization: in most cases, a heuristic would treat an image file loaded with --external-file the same (it's a heuristic because ffmpeg can't tell us whether something is an image or a video). However, even with this heuristic, it would decode the cover art picture again on each seek, which would essentially slow down seeking in audio files. This bothered me greatly, which is why I'm adding these additional options at all, and bothered with the previous commit. Fixes: #3056
* player: let frontend decide whether to use cover-art modewm42020-09-283-7/+23
| | | | | | | | | | | | | Essentially, this lets video.c decide whether to consider a video track cover art, instead of having the decoder wrapper use the lower level sh_stream flag. Some pain because of the dumb threading shit. Moving the code further down to make some of it part of the lock should not change behavior, although it could (framedrop nonsense). This commit should not change actual behavior, and is only preparation for the following commit.
* ci: fix spirv-cross build in mingw scriptssfan52020-09-251-3/+8
|
* mac: add support for the focused propertyder richter2020-09-251-0/+4
|
* mac: add an option to prevent focusing of the window on opender richter2020-09-255-3/+22
| | | | | | | | | on macOS 10.15 setting the activation policy behaves quite weirdly. the call changes the current active App to a nameless process, which probably also the reason that prevents the not focusing to work. a workaround for that, is to refocus the previous active app. Fixes #7725
* travis: fix macOS 10.12 legacy buildder richter2020-09-221-0/+3
| | | | | | | | brew update tries to update the java cask, which it tries to build from source. this takes too long and leads to a timeout of the job. we can't manually remove the java cask because of a bug in the too old brew cask version and the old formula. we just remove the whole cask tap and call it a day, since we don't need it anyway.
* wayland: only render if we have frame callbackDudemanguy2020-09-217-37/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in the olden days, mpv's wayland backend was driven by the frame callback. This had several issues and was removed in favor of the current approach which allowed some advanced features (like display-resample and presentation time) to actually work properly. However as a consequence, it meant that mpv always rendered, even if the surface was hidden. Wayland people consider this "wasteful" (and well they aren't wrong). This commit aims to avoid wasteful rendering by doing some additional checks in the swapchain. There's three main parts to this. 1. Wayland EGL now uses an external swapchain (like the drm context). Before we start a new frame, we check to see if we are waiting on a callback from the compositor. If there is no wait, then go ahead and proceed to render the frame, swap buffers, and then initiate vo_wayland_wait_frame to poll (with a timeout) for the next potential callback. If we are still waiting on callback from the compositor when starting a new frame, then we simple skip rendering it entirely until the surface comes back into view. 2. Wayland on vulkan has essentially the same approach although the details are a little different. The ra_vk_ctx does not have support for an external swapchain and although such a mechanism could theoretically be added, it doesn't make much sense with libplacebo. Instead, start_frame was added as a param and used to check for callback. 3. For wlshm, it's simply a matter of adding frame callback to it, leveraging vo_wayland_wait_frame, and using the frame callback value to whether or not to draw the image.
* player: add pause state to playback start messagewm42020-09-211-2/+3
| | | | | Now the player tells you that audio or video are playing while paused, or something.
* terminal: fix segfault when backgroundingwm42020-09-211-2/+4
| | | | | | | | | In the recent terminal commit, I "compressed" the read() error handling, and messed it up. The return value could be -1 for other non-fatal errors (such as EIO when trying to read while backgrounded), which resulted in buf.len getting messed up. Fixes: 602384348e718c77
* f_decoder_wrapper: make log prefix less verbosewm42020-09-201-2/+2
|
* audio: take paused state into account in ao_start()sfan52020-09-201-1/+1
| | | | | It makes no sense to instruct the AO to start the pull callbacks when we know there's nothing to play (only affects pull AOs).
* audio: move start() calls outside of locksfan52020-09-201-3/+10
| | | | | Pull based AOs might want to call ao_read_data() inside start(). This fixes ao_opensles deadlocking.
* mac: add an option to change the App activation policyder richter2020-09-204-1/+28
| | | | useful to hide the app icon in the Dock if necessary.
* mac: add ontop window level for desktopder richter2020-09-203-4/+9
| | | | | | this puts the window ontop of the desktop but behind the desktop icons. Fixes #7791
* options: simplify --android-surface-size handlingsfan52020-09-205-27/+8
|
* build: disable GLXwm42020-09-181-2/+3
| | | | | | Nobody needs this anymore. If not too many people complain, we'll remove this completely. Many already consider X11 and OpenGL legacy, so we don't need TWO X11/OpenGL backends.
* manpage: fix console keybindings punctuationGuido Cella2020-09-181-3/+3
|
* msg: make --msg-time show time in secondswm42020-09-182-2/+2
| | | | | More readable, similar to what --log-file will use (although the terminal code shows microseconds and uses less left padding).
* build: sort dependencies (to make build deterministic)Philip Sequeira2020-09-181-1/+1
| | | | Fixes #7855.
* command, demux: make drop-buffers reset state even harderwm42020-09-172-4/+10
| | | | Leave nothing left when it's executed.
* terminal: attempt to handle the ESC keywm42020-09-171-24/+22
| | | | | | | | | | | | | | | | | | Due to Unix being legacy garbage, it's not possible to safely detect the ESC key on terminal. The key sequences are ambiguous. The code for the ESC key also starts the sequences for other special keys. Until now, you needed to hit ESC twice for it to be recognized. Attempt to handle this better by using a timeout to detect the key. If ESC is in the input buffer, but nothing else arrived after a timeout, assume it's the ESC key. I think this is the method vim uses. Currently, the timeout is set at 100ms. This is hardcoded