summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ci/travis: remove linux buildsJan Ekström2021-07-251-15/+0
|
* github/workflows: add linux CIJan Ekström2021-07-251-0/+26
|
* stats.lua: fix ass-escape while persistent_overlay=yesAvi Halachmi (:avih)2021-07-251-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mpv has two methods to display output from text input: - show-text (scripting: mp.osd_message) has ass disabled by default (escaped), and the property osd-ass-cc can control escaping. - osd-overlay (scripting: mp.set_osd_ass or mp.create_osd_overlay) has ass enabled (unescaped), and osd-ass-cc is NOT supported. By default, stats.lua uses mp.osd_message which does support escaping. That's persistent_overlay=no. When using persistent_overlay=yes then mp.set_osd_ass is used. Due to this, the no_ASS(..) function - which is supposed to escape ass, simply returned its input unmodified when persistent_overlay is enabled. This is not a new issue, and the filters on page 1 use no_ASS() to no avail in persistent mode, however, this content (filter name and value strings) rarely actually needs escaping, and users didn't notice. However, the new page 4 (keys) does break visibly when no_ASS doesn't work, because it tries to escape arbitrary key-names and command strings, and at the very least the key '{' is bound by default, which is displayed incorrectly if escaping doesn't work. Fix this by rolling our own escaping when using mp.set_osd_ass, similar to how the mpv code does it for mp.osd_message (substrings replacements). However, this means that the set_ASS(..) function can no longer behave correctly because escaping requires going through the whole content string rather than only inserting a marker. Luckily, other than at no_ASS, set_ASS was only used at one place (text_style), which is only called from two places: - generate_graph() only needs to restore styles - not to enable ass. - add_header() is only used at the begining of page output, and uses set_ASS to enable ass initially when using mp.osd_message. So remove the set_ASS function, and instead enable ass directly at print_page using osd-ass-cc when mp.osd_message is used. Fixes #9022
* ci/travis: remove macOS buildsJan Ekström2021-07-251-58/+0
| | | | | Quite unlikely to be run afterwards, and the macOS runner on Github actions seems to work.
* github/workflows: add macOS CIJan Ekström2021-07-251-0/+27
|
* context_drm_egl: allow autoprobe selectionDudemanguy2021-07-231-5/+0
| | | | | | | | | | This was explictly coded to avoid the autoprobe way back when in 2015[1] with no real explanation. In theory, there shouldn't be any issues allowing this. If a user runs mpv in tty, this is probably what they actually want in most cases. Perhaps something strange happens on nvidia, but it should just fail anyway during the autoprobe. [1]: https://github.com/mpv-player/mpv/commit/f757163058c2e5c7136213b0f79923fcea34b71a
* js: fix tiny leaks if js_try throws(!)Avi Halachmi (:avih)2021-07-231-16/+41
| | | | | | | | | | | | | | | | | | | | | | | | As it turns out, js_try can throw if it runs out of try-stack (without/before entering either the try part or the catch part). If it happens, then C code which does allocation -> try will leak. In mpv there were two places which do alloc and then try, one of them as part of the autofree system. On both cases the leak is the smallest possible (zero allocation) - talloc_new(NULL); It's very unlikely to trigger - an autofree mpv API should be called when the try-stack is exactly full, and our next try will throw (and guaranteed to get caught at an outer level, but with a leak). Fix that by doing the allocation inside the try block, so that if try throws before it's entered then nothing got allocated/leaked. Mujs internal code also has/had similar leaks, which are getting fixed around this time (July 2021, post mujs 1.1.3). [1] exhaust the try-stack or call-stack, whichever comes first: function kaboom() { try { kaboom() } catch(e) {} }
* manpage: fix watch-later-options examplesGuido Cella2021-07-212-5/+4
| | | | | | | | --watch-later-options-remove doesn't accept multiple options, so split the example. Also suggest the more correct -clr to empty the list, and remove the workaround to not print an error with --watch-later-options=
* js: key bindings: ensure priorities for same-key bindingsAvi Halachmi (:avih)2021-07-211-4/+14
| | | | | | | | | | | | | | | | | | Previously, if a script bound the same key more than once to different functions (without removing the older bindings first), then pressing the key triggered any of the bound functions arbitrarily[1]. Now the newest binding for the same key is always the active one. If the newest binding is then removed - the second-newest will become active, etc. (same mechanism as before, except that the active key was not always the newest). [1] The order was implementation-defined, however `for (name in obj)' happens to iterate. With mujs that's currently alhabetic order, and name is from mp.add_[forced_]key_binding(key, name...) or generated internally if name is not provided. So a binding with higher alphabetic `name' value had priority over lower name value.
* options: add watch-later-optionsGuido Cella2021-07-2110-78/+127
| | | | | | | | | | This allows configuring which options are saved by quit-watch-later. Fixes #4126, #4641 and #5567. Toggling a video or audio filter twice would treat the option as changed because the backup value is NULL, and the current value of vf/af is a list with one empty item, so obj_settings_list_equal had to be changed.
* stats.lua: remove script-opts for the main keys (i/I)Guido Cella2021-07-212-15/+4
| | | | | | | Unlike the page switching/scrolling keys which are bound at runtime and therefore we need to know which (configured) keys to bind, the main keys (i/I by default) are static and can be bound via input.conf. And indeed, the builtin bindings at etc/input.conf have them already.
* manpage: minor fixesGuido Cella2021-07-212-4/+4
| | | | | | | | - The video filter to turn the video upside-down is vflip. There is no filter called "flip" so using it just causes an error. - Reword a sentence. - Add exact and all to the values accepted by cover-art-auto. They were implemented in 029ff1049b but not added to the accepted arguments.
* stats.lua: page 4 (keys): fix "excluding stats keys" - attempt 2Avi Halachmi (:avih)2021-07-201-7/+7
| | | | | | | | | | | | | | | | | | Page 4 bindings listing wants to exclude the interactive keys of the stats script itself - so that they don't hide the normal keys which are bound when stats is not interactive. It did so by testing that the bound command includes stats/__key which is how it usually looks when a script binds keys. However, if a script uses a name for the binding - like stats.lua does for the interative keys (because it later removes them by name when interactive mode ends), then the command has stats/name rather than stats/__key... To fix this, we change the names of the forced interactive bindings to start with __forced_, and that's now also what the page-4 listing excludes.
* Revert "stats.lua: page 4 (keys): fix "excluding stats keys""Avi Halachmi (:avih)2021-07-201-3/+3
| | | | | | | | | | This reverts commit 0f1654811bda0dfdd337734ec33c59b67522234a. It was an incorrect fix, because the key names do get used - to remove the forced bindings once stats exits the interactive mode. And without names - the interactive keys remained active even after stats exited interactive mode.
* stats.lua: page 4 (keys): fix "excluding stats keys"Avi Halachmi (:avih)2021-07-201-3/+3
| | | | | | | | | | | | | | | The page 4 keybinding list tries to skip the interactive bindings of stats itself (because they would hide the normal bindings of these keys when stats is not visible), and to do that it excludes commands containing "script-binding stats/__key" - which is how script-added bindings usually look like. However, keys which are added with a "name" bind stats/name rather than stats/__key... - and that's what stats.lua did till now with its interactive force-bindings. Now the interactive forced bindings are added without a name, and so they do end up using the automatic stats/__key... and get excluded.
* DOCS/mpv.rst: add cross references to --input-test and statsAvi Halachmi (:avih)2021-07-191-0/+3
|
* stats.lua: page 4 (keys): support help-like terminal printoutAvi Halachmi (:avih)2021-07-192-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | While --input-test is useful, and so is page 4 of stats, until now there was no way to simply print the list in a help-like fashion. This commit adds such printout, invoked by the script opt stats-bindlist=yes, which uses the existing page 4 code. This prints the list on startup and quits immediately - like any help page. It's awkward to invoke compared to other help pages, and it does require the stats page to be enabled (it is by default), however it is a script-generated output, and currently there's no other method to print a help page generated by a script. The printout itself is performed using lua's io.write. While reliable, it's not the standard way for mpv to print to the terminal. Other possible printout methods are mp.msg.info - which also prints "[stats]" prefix on each line (ugly), or forcing term-osd and setting an osd-message which mpv will then print at the terminal - however that's printed to stderr, and could also be subject to timing concerns since we quit right afterwards. In the future we can consider changing/integrating the invocation so that mpv itself could print a help page generated by a script, thus solving both the awkward invocation and printout-method issues.
* stats.lua: add page 4: active key-bindings listAvi Halachmi (:avih)2021-07-192-0/+168
| | | | | | | | | | | | | This is a scrollable page which also works nicely with the terminal OSD. Typically there are more than 100 bound keys. It groups the binding using fuzzy property/command/script name after simple analysis of the command string, and then further sorts the binding in each group according to the "complexity" of the key itself (plain keys -> keys with modifiers, alphabetically, etc). The alignment/grouping style is heavily inspired by @medhefgo's #8924 but otherwise it's an independent implementation.
* stats.lua: scroll: allow throttling page-rebuild (no-op)Avi Halachmi (:avih)2021-07-191-4/+5
| | | | | | | | | | | | | | | Typically the current page is rebuilt and rendered once per second, howeve, scrolling can invoke the rebuild function very frequently, even at a rate which is too fast for the rebuild function to keep up. This can result in high CPU usage and input lag. This commit adds an argument to the page-rebuild function, letting it know whether or not it's called following a scroll keypress, thus allowing it to cache intermediate data so that it doesn't have to re-calculate the whole page from scratch. This additional argument is unused currently, but it could be useful for the internal performance page - which can be relatively heavy.
* stats.lua: move internal performance from page 4 to page 0Avi Halachmi (:avih)2021-07-192-6/+6
| | | | | This allows adding more pages without the internal performance page getting stuck at the middle of the list.
* player: fix missed pause state update during reset in some casessfan52021-07-181-0/+4
| | | | | | | | When playing a new file, if paused_for_cache was true before being reset the AO would never be unpaused because that state was thrown away, leaving it stuck. Fix this by updating the pause state before resetting that variable. Note that this does not make the second update_internal_pause_state() call redundant. This fixes the same bug fb5d976cb0 was supposed to.
* Revert "audio: fix ao_reset() not clearing paused state leading to stuck AO"sfan52021-07-181-1/+0
| | | | | In hindsight this is obviously broken. This reverts commit fb5d976cb070020e35501685c9f84b9435b248e6.
* osxbundle: use python3Kiracus2021-07-172-3/+2
|
* audio: fix ao_reset() not clearing paused state leading to stuck AOsfan52021-07-161-0/+1
| | | | | This would happen when switching from playback stuck in cache wait (underrun) to another file.
* TOOLS/autocrop.lua: improve enable/disable conditionGuido Cella2021-07-141-5/+6
| | | | | | | | | | | | | | | | | | The previous code tried to disable autocrop for cover-art by testing that track-list/$vid/albumart is false, however, $vid is completely unrelated to the track-list index. It only sometimes succeeded to disable for albumart, by accident, e.g. with one audio track and one video track where $vid==1 and track-list/1 happens to be the video (cover art) track. The new code detects the currently-used video track by finding a track with type=="video" and selected==true. Unlike the previous code, it also works in scenarios with many audio/video/sub tracks. Additionally, autocrop is now enabled also with lavfi-complex, which should be considered an improvement. The previous code implicitly disabled it with lavfi-complex because $vid is nil on such case.
* demux: acquire lock before calling update_bytes_readShreesh Adiga2021-07-131-2/+2
| | | | | | | | in->byte_level_seeks field is written and modified inside update_bytes_read at the same time when demux_get_reader_state is executing, which locks the demux thread mutex. This results in a data race, reported by Thread Sanitizer when playing mp3 file of sufficient long length.
* audio: check ao driver init failure to avoid use after freeShreesh Adiga2021-07-131-9/+12
| | | | | | | | reinit_audio_filters_and_output function will free mpctx->ao_chain when there is a failure during audio initialization. So modify it to return -1 in case of init failure. The return value is checked to avoid use after free. Reported by Address Sanitizer when manually specifying --ao which triggers "Failed to initialize audio driver" error.
* lua: fix timers comment (no-op)Avi Halachmi (:avih)2021-07-131-2/+3
| | | | | process_timers() doesn't return an absolute time. It returned delta>0 or nil before f73814b1 , and since f73814b1 it can also return 0.
* terminal-unix: fix ^Z identificationMartin Tournoij2021-07-131-1/+2
| | | | | | | | | | | | | | When using "stty susp ''" to disable sending the TSTP signal with ^Z, mpv didn't recognize ^Z correctly in the terminal: [input] No key binding found for key 'Ctrl+2'. Because ASCII 26 (^Z) and above were incorrectly considered ^<NUMBER>. This commit moves the cutoff between letters/numbers from 25 to 26 so that ^Z is now detected correctly as ^<LETTER>. Additionally, it rephrases the ^<NUMBER> formula for clarity.
* DOCS/options: adds documentation for secondary-sub-visibilityRipose2021-07-121-0/+9
| | | | | | The --secondary-sub-visibility options was previously undocumented in the pull request that added it. This commit adds documentation for it and clarifies its behavior.
* command: adds support for secondary subs to sub-seek and sub-stepRipose2021-07-122-9/+42
| | | | | | | Modifies the sub-seek and sub-step commands with a second <flags> argument to specify whether to seek/step on the primary or secondary subtitles. The flag is used to index into the current_track array in cmd_sub_step_seek.
* command: add secondary-sub-start and secondary-sub-end propertiesRipose2021-07-123-4/+25
| | | | | | | Adds secondary-sub-start and secondary-sub-end properties by setting the current_track index in the m_property's priv variable which later gets accessed in get_times. Also adds a test of the secondary subtitle time properties in tests/subtimes.js bound to 'T'.
* manpage: DEL key: clarify it refers to the oscGuido Cella2021-07-121-1/+1
|
* manpage: fix typoGuido Cella2021-07-081-1/+1
|
* recorder: add support for attachments (fonts)TheAMM2021-07-084-4/+56
| | | | | | Though, only when the output format is matroska, to avoid muxing errors. This is quite useful when the input has ASS subtitles, as they tend to rely on embedded fonts.
* recorder: ignore packet queue in mux_packets()TheAMM2021-07-081-19/+8
| | | | | | | | | | | | I've looked and studied the flow in the recorder, and to my understanding, the packet queue is moot after the initial sync, maybe even then - but that's beyond me right now. With the previous choice to mux trailing packets whatever the case, this doesn't result in any new ill effects (and some missing packets at the end is no big deal). Notably, since we don't have to hold onto the packets after we get muxing, we'll never run into any issues with veeery long GOPs filling up our queue (resulting in dropped packets and much user chagrin).
* av_common: trim FLAC extradata when copying codec paramsTheAMM2021-07-081-4/+15
| | | | | | | | | | | | | | | | For muxing, FFmpeg expects the FLAC extradata to be just the bare STREAMINFO, and passing the full FLAC extradata (fLaC header and block size, with any additional channel layout metadata) will result in malformed output, as ffmpeg will simply prefix another fLaC header in front. This can be considered to be a bug. FFmpeg's own demuxers only store the STREAMINFO, hence the naivety, while our common source of FLAC streams, the matroska demuxer, holds onto the full extradata. It has been deemed preferable to adjust the extradata upon muxing, instead of in the demuxer (ffmpeg's FLAC decoder knows to read the full fLaC extradata). This fixes muxing FLAC streams, meaning recorder.c or dump-cache.
* demux, dump-cache: fix demux cache range sortingTheAMM2021-07-081-2/+2
| | | | | | | dump_cache() calls qsort() to order an array of pointers, while the comparator forgets it's receiving pointers to pointers. Since cache-dumping over multiple cache ranges is fairly rare, this seems to have gone unnoticed.
* recorder: clear packet queue after they've been muxedTheAMM2021-07-081-1/+1
| | | | | | | | | | | | | In commit f7678575a5d7f598abf267cb303e0a74db276f27, wm4 chooses to mux all remaining packets when mp_recorder_mark_discontinuity() is called and adds a call to mux_packets(). However, it is called only after flush_packets(), which clears the packets before they can be muxed out. This has no ill effects per se - recordings end on keyframes, as before - but judging from his commit message, the intention explicitly was to output the inter frames, since long GOPs can mean several seconds of missing content from the output. So, clear the stream packet queues only after the final mux. Also, flushing can mean both discarding and committing. What a country!
* player: add append-play flag to loadlistGuido Cella2021-07-062-3/+10
| | | | Closes #5664.
* osc: expose osc-visibility via shared-script-propertiesAvi Halachmi (:avih)2021-07-061-0/+1
| | | | | | | | | | | | | | | | osc-visibility can already be changed at runtime via script-message or other means, but until now there was no way to tell what the current state is. Now shared-script-properties/osc-visibility reflects this state. It's output-only by the osc - changing it does not affect the osc. Useful if a script wants to change osc-visibility temporarily, and later restore to its original state. There's no way to coordinate if more than one script wants to change it, but that would be a hard problem to solve anyway, even if the osc itself tried to coordinate such requests from different sources.
* wayland: refactor surface scalingDudemanguy2021-06-302-33/+56
| | | | | | | | | | | | | | | Another day, another wayland refactor. Way back when, dcc3c2e added support for the hidpi-window-scale option (something you probably should never set to no but whatever) to wayland. Well technically, it never had any runtime toggling support (don't remember if detecting when vo_opts changed was possible or not then; maybe not). Anyways in the process of fixing that, I went ahead and refactored how this is all handled. The key difference is that when hidpi-window-scale is disabled, wl->scaling is directly set to 1 instead of forcibly setting wl->current_output->scale to 1. Note that scaling operations don't always require a geometry reset/resize so set_surface_scaling needs to be separate from set_geometry. The logic here is kind of complicated but it (should) be correct.
* sub: fix subs/lyrics on music files with sub-past-video-end=norcombs2021-06-271-1/+3
| | | | Regressed in 11423acf3
* wayland: fix wl_surface_set_buffer_scale usageDudemanguy2021-06-273-3/+2
| | | | | | | | | | | The wl_surface lives for the entire lifetime of the vo. It's only neccesary to set the scale initially and when the output scaling changes (the surface moves to a different output with a different scale or the output itself changes it scale). All of the calls that were being made in the egl/vulkan resize functions are not needed. vo_wlshm wasn't correctly rescaling itself before this commit since it had no logic to handle scale changes. This should all be shared, common code in the surface/output listeners.
* wayland: always be sure to initially try to renderDudemanguy2021-06-275-8/+7
| | | | | | | | | | | | | | | | | | | A subtle regression from c26d833. On sway if mpv was set to be a floating window in the config, set_buffer_scale would actually get applied twice according to the wayland log. That meant a 1920x1080 window would appear as a 960x540 window if the scale of the wl_output was set to 2. This only affected egl on sway (didn't occur on weston and was too lazy to try anything else; probably they were fine). Since wl->render is initially false, that meant that the very first run through the render loop returns false. This probably caused something weird to happen with the set_buffer_scale calls (the egl window gets created and everything but mpv doesn't write to it just yet) which makes the set_buffer_scale call happen an extra time. Since it was always intended for mpv to initally render, this is worth fixing. Just chnage wl->render to wl->hidden (again) and flip the bools around. That way, the initial false value results in render == true and mpv tries to draw on the first pass. This fixes the weird scaling behavior because reasons.
* wayland: remove unused includesDudemanguy2021-06-272-6/+0
| | | | Presentation time only lives in in wayland_common.
* wayland: handle app id option less stupidlyDudemanguy2021-06-263-6/+2
| | | | | | Not sure what I was on when I wrote this. wayland-app-id is supposed to default to "mpv". Just set that in the vo_sub_opts and don't do this weird m_config_cache_write_opt thing. Also make the doc entry nicer.
* wayland: reorganize wayland common codeDudemanguy2021-06-265-948/+962
| | | | | | | Mostly a cosmetic change that (hopefully) makes things look better. Some functions and structs that were previously being exported in the wayland header were made static to the wayland_common.c file (these shouldn't be accessed by anyone else).
* stats.lua: add scaled resolutionDudemanguy2021-06-251-0/+7
| | | | | Calculate the actual scaled size of the video from osd-dimensions and display it on the stats page.
* DOCS: fix typo on seekbarkeyframeshooke0072021-06-241-6/+6
|
* TOOLS/lua/autoload: load files even if current file is hiddenLaserEyess2021-06-241-1/+3
| | | | | | | When the current file is hidden and `ignore_hidden` is true, autoload will skip loading other files in the current directory. Make sure that the current file is always counted for autoloading even if it is hidden.
* TOOLS/lua/autoload: add ignore_hidden optionLaserEyess2021-06-241-2/+4
| | | | | | | | | | | | | | | In 8a7614a0fb0d4f1073057049933972bb1113c14c files that start with a '.' were blacklisted from autoload.lua. Since then 35e8710b86545849484f6544a16047792fa75bb2 was introduced and explicitly whitelisted file extensions. With this change, there is no longer a reason to blacklist all files starting with '.', because it is valid to have a file called '.hidden.mkv', and there is no chance of hidden files such as '.bashrc', '.DS_STORE', '.gitignore', etc. being autoloaded by mpv. This commit tries to keep the same behavior as before, which is to by default not load hidden files, but allows the user to optionally allow hidden files to be autoloaded.
* player: fix property nameGuido Cella2021-06-241-1/+1