summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* common: stream: don't mention Libav in errors/warningsllyyr2024-01-203-4/+4
|
* TOOLS/autocrop.lua: drop Libav mentionllyyr2024-01-201-1/+1
|
* DOCS/*: remove mentions of Libavllyyr2024-01-205-18/+14
|
* console.lua: highlight the selected suggestion in the terminalGuido Cella2024-01-201-3/+10
|
* libplacebo: fix out-of-bounds read with --really-quietGuido Cella2024-01-201-1/+7
| | | | | With --really-quiet the message level is -1 which is not in the msg_lev_to_pl_log enum, so handle it explicitly.
* scripting: don't observe properties with type nilGuido Cella2024-01-204-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | mp.observe_property('foo', nil, ...) calls the handler at least 2 times on each playlist change even when the property doesn't change. This is dangerous because if you haven't read observe_property's documentation in a long time this is easy to forget, and you can end up using it for handlers that are computationally expensive or that cause unintended side effects. Therefore, this commit discourages its use more explicitly in the documentation, and replaces its usages in scripts. For console.lua, observing focused with type nil leads to calling mp.osd_message('') when changing file while playing in the terminal with the console disabled. I don't notice issues from this, but it's safer to avoid it. For playlist and track-list this doesn't really matter since they trigger multiple changes on each new file anyway, but changing it can avoid encouraging people to imitate the code. One usage of none in stats.lua is kept because according to b9084dfd47 it is a hack to replicate the deprecated tick event.
* osc: don't autohide mouse cursor when hovering over windowcontrols titlenanahi2024-01-201-0/+14
| | | | | | | | | | | When the mouse cursor is hovering over the (CSD) windowcontrols title, the osc keeps displaying, but the cursor autohide isn't disabled like other visible regions. Fix this by disabling the cursor autohide in this region. All other existing behaviors of the mouse cursor in this region are unchanged, including triggering main window area input and allowing VO dragging.
* TOOLS/lua/autoload: skip loading when playback is abortedsunpenghao2024-01-201-0/+6
| | | | | | Quickly going through a directory with too many loadable files causes the autoload tasks to pile up and exiting the player will take forever. Avoid this by skipping loading when playback is aborted.
* DOCS: reorder --volume-max documentation to where --volume isnanahi2024-01-201-4/+4
|
* DOCS: add documentation for --volume-gain optionsnanahi2024-01-202-0/+8
|
* command: add osd display for volume-gainnanahi2024-01-201-0/+3
|
* audio: add --volume-gain options to control volume in decibelsnanahi2024-01-204-2/+36
| | | | | | This adds volume-gain, volume-gain-max, volume-gain-min options, which can be used to control audio volume and target dynamic range in decibels. The gain is applied on top of the existing volume setting.
* sub: fix sub-seek and sub-step -1 with unknown duration subsGuido Cella2024-01-201-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | f9cefbfec4 made it so mp_ass_flush_old_events() is continously called on subtitles with unknown duration, without explaining why, breaking sub-seek/step -1 with a VO (the issue does not occur when showing subtitles in the terminal because get_bitmaps() is not called). I don't experience any issue after removing the call, so delete it to fix these commands. After removing that, you can sub-seek -1 once after regular playback, but not after seeking and thus not multiple times in a row. This is caused by a714f8e928 which fixed subtitles with unknown duration being duplicated when seeking with a VO (it does not happen in the terminal) by clearing old lines on seeks, which broke sub-seek -1 and sub-step -1 in a second way after any seek. The proper fix is to remove the line ctx->num_seen_packets = 0 for subtitles with unknown duration instead, which lets decode() return early when a line has already been shown. Having removed these 2 lines, I also removed sd->preload_ok = false, and thus the whole conditional, since according to sub/sd.h preload_ok only needs to be set to false when old subtitles are discarded, and they are no longer discarded, The bug can be reproduced with mpv --sub-file=<(curl 'https://music.xianqiao.wang/neteaseapiv2/lyric?id=1399616170' | jq -r .lrc.lyric) 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
* demux_lavf: detect ico as imagesGuido Cella2024-01-191-0/+1
|
* wayland_common: guard against negative configure sizesnanahi2024-01-191-0/+5
| | | | | | Negative values are nonsense to mpv, and can cause protocol error afterwards, like xdg_surface::set_window_geometry which doesn't accept negative values. Treat any negative values as zero (client determines size) for now.
* command: fix bitrate unit capitalizationnanahi2024-01-181-1/+1
| | | | This is 1 billion times smaller than it should be in SI units.
* stats.lua: make capitalization consistent across pagesllyyr2024-01-171-11/+11
|
* win32: change to alphanumeric mode on the first keypressnanahi2024-01-151-0/+10
| | | | | | Needed in case the timer solution fails. Note that this will leave the mode indicator in the language bar showing the original mode until a key is pressed.
* win32: default to alphanumeric input when the IME is first initializednanahi2024-01-151-0/+30
| | | | | | Some IMEs initialize to composition mode for new windows, which is undesirable for keyboard control. Default to alphanumeric input to solve this.
* win32: move IME candidate window to video windownanahi2024-01-153-0/+11
| | | | | By default the IME candidate window appears on the top left corner of the monitor. Move it to the video window for sane behavior.
* win32: handle WM_UNICHARnanahi2024-01-151-3/+10
| | | | WM_UNICHAR is sent by some 3rd-party IMEs.
* win32: re-enable IMEnanahi2024-01-151-12/+11
| | | | | | | | | | The IME is useful for text input. Additionally, Alt+Shift input language switching doesn't work when IME is disabled even when the languages don't require IME. Re-add the VK_PROCESSKEY logic to ensure that IME is handled properly. Reverts bf6b981367e45c3f926d3e667bba3f3ed6e9dc37.
* filter_sdh: optimize get_char_bytesDudemanguy2024-01-151-5/+5
| | | | | | | strlen is only relevant if the length is less than [1, 4], so this can be replaced with strnlen instead which will only traverse characters upto the maxlen insted of the entire string length. It also makes MPMIN unneeded. Also fix a comment.
* terminal: don't print escape sequence if not ttyKacper Michajłow2024-01-152-3/+7
|
* terminal-unix: don't install handler before pipeNRK2024-01-151-4/+5
|
* terminal-unix: move all processing out of sighandlerNRK2024-01-151-23/+16
| | | | | | | | | | | | | | | | | | | commit fa9e1f06f tried to move signal unsafe operations out of signal handlers but mistakenly introduced a race. before, sigtstop would process the following in order: 0. do_deactivate_getch2(); 1. raise(SIGTSTP) that commit moved 0 out of the signal handler (due to it being unsafe) but kept 1 in there. this may mess up the ordering of these operations. this commit moves everything out of the handler so that things happen in proper order. since things are now moved out of the handler, SA_RESETHAND is no longer being applied to SIGTSTP. since that can result in races if multiple signals are delivered faster than we can respond to them.
* console.lua: style log lines in the terminalGuido Cella2024-01-144-33/+50
| | | | | | | | | | When running the console in the terminal, style log lines with the same escape sequences as msg.c. mp.input can also specify terminal escape sequences, e.g. a script to select a playlist entry can invert the color of the selection. Also add a missing newline to help's error message.
* terminal-unix: don't set `SA_RESETHAND` for SIGTERM/SIGQUITllyyr2024-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | This can cause mpv to abruptly quit without following the proper uninit process when a second `SIGTERM` or `SIGQUIT` is sent and mpv didn't quit on the first one already. This is because the default action for these signals is to terminate the program immediately, similar to `SIGKILL`, and `SA_RESETHAND` resets the `quit_request_sighandler` to `SIG_DFL` for the default action. Also keep the `SA_RESETHAND` flag for SIGINT because the current behavior is to quit after receiving two Ctrl+C no matter what, this is probably convenient and worth keeping. This change is because some tools (e.g. GNU timeout) send SIGTERM twice after the timeout period. An easy way to reproduce is with `timeout 1 mpv [...]` where mpv would quit abruptly anywhere from half the time to once every 50 attempts depending on your luck.
* Revert "github/workflows: don't install angleproject on msys2"Kacper Michajłow2024-01-142-0/+3
| | | | | | No longer needed after removal of 32-bit builds. This reverts commit d56ad8f0329e973d4c41e93f8491b4d3ceac9793.
* github/workflows: disable MSYS 32-bit buildsKacper Michajłow2024-01-141-2/+0
| | | | | | | | | | | | | | While mpv can be build for 32-bit platforms, MSYS started dropping some of the 32-bit packages [1]. We cannot be asked to monitor and fix CI build each time a dependency package randomly disappears [2]. Disable MSYS 32-bit builds if the support for this platforms is phased out upstream. Sadly this will reduce our build coverage. [1] https://www.msys2.org/news/#2023-12-13-starting-to-drop-some-32-bit-packages [2] https://github.com/msys2/MINGW-packages/commit/fff2fa3711e3cf1c9b65b12784ab3d9428a779f1 See also: https://github.com/msys2/MINGW-packages/issues/19747
* wayland: accept active modifiers even if they aren't physically heldllyyr2024-01-131-1/+1
| | | | | We don't care about the physical state of keys, only if they are effective or not and whether they should affect key processing.
* wayland: don't ignore key modifiers if they were consumedllyyr2024-01-131-1/+1
| | | | | | | | | | According to the xkbcommon docs, `xkb_state_mod_index_is_consumed` is true when a modifier *may affect* key translation. A key modifier may be consumed but not be active. See xkb documentation for this function for further details. This breaks key modifiers in cases where L_Shift+R_Shift for example is used to change keyboard layout with `xkb_options grp:shifts_toggle`. Instead, replace it with a simple check for a valid modifier.
* DOCS/mpv: the playback position is not remembered after poweroffGuido Cella2024-01-131-4/+4
| | | | | | | | | | | This doesn't actually work on either Windows or Linux with --terminal. With --no-terminal or --no-input-terminal the SIGTERM handler is never registered, so it definitely can't work. Just remove the note about signals because it would be complicated to explain that they don't terminate abruptly only with --terminal and only if that signal has a handler, and it wouldn't be of interest to most users.
* player: add forced choice to subs-with-matching-audioDudemanguy2024-01-135-10/+17
| | | | | | | | | | fe875083b3d30b06ef77745f40570e8f63afec2 confused things a bit and made --no-subs-with-matching-audio actually mean what it says: no subtitles if the languages match. However, the option actually meant no non-forced subtitles not no subtitles at all. This isn't really intuitive so instead of changing the behavior back to the old way (we already have a release since then), add a third option "forced" which is equivalent to the old meaning of --no-subs-with-matching audio. Fixes #13151.
* scripting: add mp.inputGuido Cella2024-01-138-42/+378
| | | | This lets scripts get textual input from the user using console.lua.
* filter_sdh: fix incorrect placement of null terminatorDudemanguy2024-01-121-1/+1
| | | | | | | The +1 here is not correct. For a 4-byte unicode character, this would throw a runtime error because the +1 would try to assign the null terminator past the actual bound of our array. Just remove it since it should be exactly equal to whatever we have for bytes.
* filter_sdh: sanitize get_char_bytes heuristic to avoid overflowDudemanguy2024-01-121-4/+4
| | | | | | | | | | | There's a simple check in filter_sdh that gets the bytes of the first character in a string in order to do pointer arthimetic to filter the string. The problem is that it is possible for the amount of bytes to be greater than the actual length of the string for certain unicode characters. This can't be worked with so enforce the strlen as the absolute minimum here to avoid overflow situations. Fixes #13237.
* ao_null: fix reset() implementationsfan52024-01-121-1/+2
| | | | | | | | Stopping output implies that it can't be paused anymore. This is consistent with the documented API in internal.h as well as the behavior of other AOs. resolves #13267
* github/workflows: don't install angleproject on msys2llyyr2024-01-122-3/+0
| | | | | | | This package isn't available for i686 anymore, and not worth the hassle to only install it for win64 since it isn't particularly useful. See: https://github.com/msys2/MINGW-packages/commit/fff2fa3711e3cf1c9b65b12784ab3d9428a779f1
* demux_lavf: remove `fix_editlists` hack for mp4llyyr2024-01-111-8/+1
| | | | | | | | | | Remove this "hack" from 2017 which disabled `advanced_editlist` while demuxing mov/mp4. See: b7b12c36af96af14b8371d16c5a7f98a7a17915f as well as b86a2316df260de70012fb05dbddf06118b00611 At present, advanced edit list support seems to be mature enough that it doesn't need to be disabled by us and disabling it seems to break more files based on testing with `elist` files in FFmpeg's FATE suite.
* f_lavfi: provide color_space and color_range params for lavfillyyr2024-01-111-0/+4
| | | | | | | | Only when the lavfi version is sufficiently new enough to actually have these fields. See: https://github.com/FFmpeg/FFmpeg/commit/2d555dc82d4ccd3c54c76e2fb3c861a8652de1c6 Fixes #13234
* x11_common: prefer Xft.dpi for HiDPI scalingnanahi2024-01-101-1/+41
| | | | | | | | Xft.dpi is much more widely used nowadays by GUI programs compared to the X11 screen DPI. This is the best we can get for a vendor-neutral scaling preference value under X11 in terms of adoption. If Xft.dpi isn't available, the X11 screen DPI is used as a fallback.
* x11_common: allow DPI scale in unit of 0.5nanahi2024-01-102-16/+25
| | | | | | | | ~144 DPI displays are pretty common and neither 1x nor 2x scales are the right size for it. Allow DPI scale in unit of 0.5 to fix this. Additionally, add a note about the current behavior of the API used to get the scale factor.
* msg: return zero length if bstr_split_utf8 failsKacper Michajłow2024-01-101-1/+1
| | | | | | | | | | In theory bstr_split_utf8 should skip invalid sequence and move further, but it doesn't do that currently, so just the string if unsuported code if found. Fixes infinite loop on code.len == 0 condition. Fixes: 5864b72d1a0aecd7e2d56e546fb615d291c88274
* vo_gpu_next: respect d3d11 swapchain output format preferencenanahi2024-01-064-0/+20
| | | | | | | | | | Currently, libplacebo always tries to reconfigure the d3d11 swapchain to a 10-bit output format because disable_10bit_sdr isn't set to true, even when an 8-bit format is explicitly requested via --d3d11-output-format. Fix this by passing the requested output format preference to libplacebo. Document that this option may be ignored.
* README: specify the meaning of "not too ancient Linux"nanahi2024-01-061-1/+2
| | | | | | Commits like 3b198668821685295e1e122df92adfbacc55a8f5 show that in practice, only the lastest releases of popular distributions are supported.
* README: recommend --profile=fast for crappy GPUsnanahi2024-01-061-1/+2
| | | | | | | 0.37.0 uses more computationally expensive shaders by default, which can cause high GPU usage and frame drops even for modern integrated GPUs, especially with 4K and high fps contents. Recommend --profile=fast for them.
* DOCS/options: note that --geometry doesn't fully work on waylandDudemanguy2024-01-041-0/+5
| | | | | Positioning windows won't work on wayland so note it here to hopefully avoid confusing users.
* console.lua: expand ~/ in file completionGuido Cella2024-01-041-0/+10
| | | | | | | Makes Tab expand loadfile ~/ to loadfile /home/$USER/. I used expand-path instead of os.getenv('HOME') to make it work on Windows.
* msg: improve term_disp_width to support unicodeKacper Michajłow2024-01-041-13/+12
| | | | | | | All characters are assumed to be single-width. This is consistent with the rest of the code and documentation. Fixes: #13150
* ci/build-freebsd: use march=native for QEMU hosted buildKacper Michajłow2024-01-041-1/+1
| | | | | | | | | | | | | | | | | This is workaround to not emit instructions that are broken with current version of QEMU used in CI job. Fixes SIGBUS on valid code when executed in QEMU caused by issue with CVTPS2PD instruction. QEMU issue: https://gitlab.com/qemu-project/qemu/-/issues/1377 QEMU fix: https://gitlab.com/qemu-project/qemu/-/commit/abd41884c530aa025ada253bf1a5bd0c2b808219 Should be resolved after QEMU update to 8.2.0: https://github.com/cross-platform-actions/action/issues/78
* player/video: set video_out to NULL before broadcasting eventsKacper Michajłow2024-01-041-1/+1
| | | | This avoids possible reference of video_out after destory.
* command: allow changing --gpu-api and --gpu-context at runtimeGuido Cella2024-01-011-1/+4
|
* DOCS/ao: change wrong note on which driver is preferredGuido Cella2024-01-011-3/+2
| | | | | | | | --ao=pipewire has been preferred on Linux for a long time, and this note even makes it sound like alsa is preferred on any system. Just say that the print order is the order in which the drivers are tried so this note won't have to be updated again in the future, like --gpu-context's documentation does.
* console.lua: hide the cursor when unfocusedGuido Cella2024-01-011-1/+3
| | | | | | | | | | | This is commonly done to understand whether a window is focused. This explicitly checks if focused is false instead of unavailable to not break the cursor where focused is unimplemented like on --vo=drm. The cursor is taller than the input text so it is made transparent instead of completely removing it so that the log doesn't move up and down while toggling focus. Alternatively, cheight = opts.font_size * 8 can be changed to 7.
* console.lua: don't reinsert completion_append after cyclingGuido Cella2024-01-011-8/+10
| | | | | | | 43ed0a83d0 avoided reinserting the string that is appended after certain completions when it is already after the cursor when inserting the longest common prefix of the suggestions. Do the same when cycling through them.
* DOCS/man: remove "Linux desktop issues" sectionnanahi2023-12-292-24/+5
| | | | | | | | | | | | | | | | | | | This section has no reason to exist anymore because: - No "desktop issues" sections exist for other platforms, and all other Linux-specific issues are represented as notes for options. This section only addressed one specific issue. - This section was shortened significantly with commit 2c46ae8ea3d9ae32b52eae9092f0517d69dcedbc, so there is no need for this to be a separate section anymore. - This section was shortened again with commit d5e681e95df759a4df8608cc773931e3f97c9460, when the original rationale behind this section became outdated because GNOME has implemented the idle inhibit protocol. The historical info is moved to the documentation of --stop-screensaver.
* vo_sdl: support the focused propertyGuido Cella2023-12-291-0/+7
|
* DOCS/man: use the correct directive type for "Warning" admonitionsnanahi2023-12-282-9/+9
| | | | | | | Some places in the manpage uses `.. admonition:: Warning` instead of the specific directive type `.. warning::` for warning admonitions. This causes the "Warning" text appearing in black color instead of red. Correct them here.
* win32: add support for --input-cursor-passthrough optionnanahi2023-12-282-1/+21
| | | | This completes the support for all supported desktop platforms.
* screenshot: remove artificial limit on the number of screenshots takennanahi2023-12-281-1/+1
| | | | | | This allows taking more than 99999 screenshots in a single session, and also for the case when a sequence of 99999 screenshots already exists on the filesystem.
* DOCS/options: fix documentation for --force-window window sizenanahi2023-12-281-1/+1
| | | | | | The value has been wrong since ca2b05c0fbc9a51472b1a5a94d016e977c6c87c3, and recent commit 8b4a995a9d7ee7b65a5d2c893d72844d551d9697 still didn't fix it.
* various: use correct PATH_MAX for win32sfan52023-12-276-15/+35
| | | | | | | | In commit c09245cdf2491211f3e0bfe47f28cc0e0a2e05c8 long-path support was enabled for mpv without actually making sure that there was no code left that used the old limit (260 Unicode chars) for buffer sizes. This commit fixes all but one case.
* osdep: clarify and rename a constant on win32sfan52023-12-271-3/+5
| | |