Commit Graph

51431 Commits

Author SHA1 Message Date
nanahi 579349b21c screenshot: remove artificial limit on the number of screenshots taken
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.
2023-12-28 15:45:08 +00:00
nanahi cdbc1ceb70 DOCS/options: fix documentation for --force-window window size
The value has been wrong since ca2b05c0fb,
and recent commit 8b4a995a9d still didn't
fix it.
2023-12-28 13:12:38 +01:00
sfan5 9565675488 various: use correct PATH_MAX for win32
In commit c09245cdf2
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.
2023-12-27 22:55:56 +01:00
sfan5 f57ec94d9f osdep: clarify and rename a constant on win32
This is about the maximum filename not path length.
2023-12-27 22:55:56 +01:00
Ikko Eltociear Ashimine dd48a53b65 various: fix capitalization of 'GitHub' 2023-12-27 22:11:58 +01:00
Kacper Michajłow 1306ea9854 msg: reduce nesting in mp_msg_flush_status_line
Cosmetic change only.
2023-12-27 20:59:22 +00:00
Kacper Michajłow cadb68487e msg: keep status line on the end of file
Apparently found useful by some users.

Fixes: #13092
2023-12-27 20:59:22 +00:00
Guido Cella 19a37f625f console.lua: refactor find_common_prefix
Reuse common_prefix_length() to make find_common_prefix() shorter and
faster by not creating many temporary strings.

The decrease in the average time to run find_common_prefix() over 1000
calls I measured is:

set \<Tab>: 1e-4s -> 1e-5s
set s\Tab>: 1e-5s -> 5e-6s
2023-12-26 20:12:24 +01:00
der richter 4d7763e6a6 mac: add support for --input-cursor-passthrough option 2023-12-25 13:59:48 +01:00
Guido Cella dde2776655 DOCS/options: fix --image-display-duration's documentation
- --image-display-duration does not hide the OSC.
- Saying "Setting --image-display-duration" makes no sense because it is
  not a boolean and it cannot be unset.
2023-12-25 09:46:34 +01:00
JohhanSam 68eaaf0da3 DOCS/interface-changes: add --secondary-sub-ass-override
Option added in b563b2ae
2023-12-24 13:09:13 +01:00
Kacper Michajłow a44f0e574d common/av_log: do not assume AVClass.item_name is always set
After recent change in FFmpeg it is not longer safe to call item_name.

Ref: 0c6203c97a
2023-12-24 12:50:24 +01:00
der richter 0d47e48437 mac: add support for --auto-window-resize option
Fixes #9325
2023-12-23 01:15:53 +01:00
der richter fa4ca16f66 mac: update geometry/autofit opts on runtime 2023-12-23 01:15:53 +01:00
Andarwinux e832f4969f win32: opt in to the windows segment heap
ref: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#heaptype

Improves demuxer cache recycling speed at the cost of a slight CPU usage increase.
SegmentHeap is supported in Windows 10, version 2004 (build 19041) and later.
2023-12-22 16:36:31 +01:00
stax76 c09245cdf2 win32: support long file paths 2023-12-21 17:40:45 +01:00
Dudemanguy 069143252a osc: allow disabling special mouse wheel behavior
When hovering certain elements over the OSC, using the mouse wheel can
result in special commands (such as seeking, changing audio tracks,
etc.) Not everyone neccessarily wants this feature, so add an option to
make it possible to disable all of it. Maybe more fine-tuned control
would be more ideal, but probably not worth it. Fixes #13096.
2023-12-21 09:13:11 +01:00
Guido Cella 17be6e1990 terminal-unix: enable the cursor after ctrl+z
24270b8587 disabled the cursor while mpv is running, but if you send mpv
to the background, it is not re-enabled until you run bg, and not even
after that if mpv is paused. Fix this by enabling the cursor from the
SIGTSTP handler.
2023-12-18 15:03:40 +00:00
dyphire b563b2aed0 options: add --secondary-sub-ass-override
Default: strip. preserve the old behavior
2023-12-18 14:58:34 +00:00
Guido Cella 702b3eb956 lua: don't return a second value from successful format_json
Even for successful calls, utils.format_json returns nil as the second
return value. This doesn't have any purpose and is not documented, and
it is inconvenient for passing JSON to script-message, because

mp.commandv('script-message', 'foo', utils.format_json(...))

errors because mp.commandv receives nil as the fourth argument.

This commit makes format_json return only one value in case of success
to fix this.
2023-12-17 18:38:33 +01:00
sfan5 00942d56ba command: support passing scale to `keypress` 2023-12-17 18:36:16 +01:00
sfan5 a08e8e0b46 input: add value argument for mp_input_put_key_artificial 2023-12-17 18:36:16 +01:00
HRXN ba547cb098
OSC: fix indentation and stray whitepace 2023-12-17 08:46:44 -05:00
Dudemanguy 1112de220b sd_ass: remove unneeded ontop variable
Missed in 3250f6e447. Note that the
hardcoded ass alignment value is not used anymore as of that commit, but
we should ideally be moving towards secondary subs actually being
customizable via ASS anyways.
2023-12-16 15:25:32 +00:00
Dudemanguy b0f31a7637 player: refactor secondary subtitle options and properties
Over the years, we've accumulated several secondary subtitle related
options and properties, but the implementation was not really consistent
and it wasn't clear what the right process for adding more should be. So
to make things nicer, let's refactor all of the subtitle options with
secondary variants (sub-delay, sub-pos, and sub-visibility) and split
them off to a new, separate struct. All of the underlying values are
stored in an array instead for simplicity. Additionally, the
implementation of some secondary-sub-* properties were slightly changed
so there would be less redundancy.
2023-12-16 15:25:32 +00:00
Dudemanguy ace2d6506f DOCS/options: fix documentation for replaygain-clip
f1c4d20e65 added this option, but the
documentation is actually backwards. --replaygain-clip allows clipping.
Having it disabled, the default, prevents it. Keep the behavior the
same, but change the documentation to reflect reality. Closes #13111.
2023-12-16 11:14:47 +01:00
Dudemanguy 054dde0424 demux_mkv: add HDMV Text subtitles to subtitle codec list
Such subtitles will not actually work since FFmpeg doesn't yet have
a decoder for them, but this prevents some error message spam at least.
2023-12-16 00:21:49 +02:00
Dudemanguy d8a0808de5 demux_mkv: check that subtitle type is set before accessing it
Fixes crashes in case of unknown subtitle track being found, as
the original ARIB caption logic added in 0da0acdae8
did not attempt to take into mention tracks with unknown type.

Fixes #13106
2023-12-16 00:21:49 +02:00
Philip Langdale ef56c0c20a hwdec_drmprime: try and declare support for weird forked ffmpeg formats
As a result of the work I did the explicitly check for formats
supported by the vo in the f_autoconvert logic, I introduced a
regression in the handling of the rpi4_8 and rpi4_10 formats. These
require special handling because they only exist in the rpi forks and
not upstream ffmpeg, which means they don't have stable pix fmt values
that we can use directly.

Previously, we simply didn't declare them as supported, which was ok,
as nothing was really enforcing the list of supported formats, but that
has changed.

As we still can't simply use the pix fmts, I had to do a slightly
ridiculous dance to look them up by name, and if they exist, then
register them as supported.

Good times.
2023-12-15 14:17:19 -08:00
Philip Langdale 672829439a hwtransfer: actually treat hardware formats as supported input formats
It's conceptually broken for an hw format to be identified as a
supported sw format for an hwdec, but in the case of the drm hwdec,
we have no choice but to do so for the weird rpi formats, as these
are declared, incorrectly, as hw formats in their forked ffmpegs.

This means we can't reject such formats as a matter of principle,
as we do today. Instead let's just assume that such formats can always
be accepted as-is, and will never require conversion. In practice, this
is either true or it will fail in the VO, which is the old behaviour
from before I introduced the conversion filter capability.
2023-12-15 14:17:19 -08:00
Dudemanguy f575b3d1bd w32_common: remove executable bit from file
5736737750 mistakenly changed the mode
from 644 to 755. Change it back.
2023-12-15 10:27:44 -06:00
der richter c661435648 mac: add support for drag-and-drop option 2023-12-15 16:59:52 +01:00
Guido Cella 8ceaec1742 console.lua: clear the suggestions when you move the cursor
Clear completion suggestions from functions that move the cursor, so
that you can't insert suggestions at the wrong spot by pressing Tab
again after moving the cursor,

Also clear suggestions from some editing functions that were never
updated. It is not actually necessary to clear suggestions from
functions that remove text in front of the cursor, but since
handle_del() already clears them, let's just clear them everywhere.
2023-12-15 15:45:11 +00:00
Guido Cella 86c8ef5c1f console.lua: complete current-tracks sub-properties
Also inline option-info's sub-properties so we don't have to define
sub-properties at the top of the function for every one we decide to
complete.
2023-12-15 15:45:00 +00:00
Guido Cella b09deda37a console.lua: implement case-insensitive completion
This is useful for completing files and more rarely for profiles. It
will also be useful to third-party scripts interacting with the console
once the API to do it is merged.
2023-12-15 15:44:48 +00:00
der richter f805b180d0 mac: add support for window-id property
returns the NSWindow
2023-12-15 09:20:10 +01:00
Leo Izen e9d0a31dfe demux/codec_tags: add jxl/jpegxl extension mapping to image codecs
Add .jxl as a file extension that maps to an image codec. Note that
this will include animated JXL files, but .gif is also on that list so
they are not different in that regard.
2023-12-14 12:36:42 +01:00
karelrooted 3250f6e447 options: add --secondary-sub-pos
The default value is 0 (on the top of the screen)
2023-12-13 21:18:57 +00:00
Niklas Haas b690531f30 Revert "OSC: Remove merriment"
This reverts commit af2635d8c9, and
restores feature parity with VLC.
2023-12-13 19:29:39 +01:00
Mia Herkt af2635d8c9
OSC: Remove merriment
I honestly don’t care either way but I also don’t believe this innocent
and cute hat is worth repeatedly having people show up on the issue
tracker to aggressively virtue signal and then shit-talk the project
elsewhere when their “concerns” are ignored and made fun of.
For the record, I approve of neither brand of childish nonsense.

If your workflow depends on December festivities, feel free to use an
alternative OSC implementation.

Fixes #13082 and #9548
2023-12-13 18:06:22 +01:00
Dudemanguy 6d1383383b playlist: correctly populate playlist-path with the --playlist option
When using the --playlist option on the commandline, it would mark all
entries on the command as having the playlist-path of the value of that
passed option, not just the ones that were expanded from it. Fix this by
moving the playlist_populate_playlist_path to the same place where the
playlist file gets expanded.

Ref https://github.com/mpv-player/mpv/issues/13075#issuecomment-1852179164
2023-12-13 15:25:14 +00:00
nanahi 9b001b448c github/issue_template: unify spellings
"behavior" is written in US English form in all templates except here.
2023-12-12 18:56:40 +01:00
nanahi 415901dedd github/issue_template: request uploading attachments to github
https://0x0.st/ has a maximum retention period of 1 year, and much less
for larger files. Uploading them directly to github issue avoids this,
which most people are already doing anyway because of greater convenience.

log file: don't request 0x0.st.
sample files: recommend github first.
2023-12-12 18:56:40 +01:00
nanahi ebb7fbc5d2 github/issue_template: unify requested information across templates
Add more and unify requested information:

windows, linux, others: request GPU model to provide more info about
known hardware limitations and hardware/driver combo bugs.
windows, others: request general GPU info.
build: request meson version.
windows, linux, others: request backtrace in case of crash.
all: clarify the language of not attaching a log file.
2023-12-12 18:56:40 +01:00
Dudemanguy 9e27b1f523 sub: don't busy loop if the player is paused for cache
When updating subtitles while paused, mpv waits until a packet is
available. However in the case of a network stream, it is possible that
mpv will pause itself when buffering for cache reasons. This makes that
particular loop do a busy loop and can take a long time depending on
network streams. Simply just don't do the loop here if we are paused for
cache reasons. Fixes #13077.
2023-12-12 18:54:46 +01:00
Vonfry 8f22916f85 etc/mpv.desktop: add audio/vnd.wave and video/vnd.avi 2023-12-12 00:32:15 +01:00
nanahi 566a96f220 w32_common: rename some camelCase struct member names to snake_case 2023-12-10 16:35:40 +01:00
nanahi 66ebce758f win32: temporarily disable aero shake while dragging hack is active
The dragging hack can cause unwanted aero shake activation.
Prevent this by saving the window arrangement state before dragging,
temporarily disable it while dragging hack is active, and restore to
the original state after dragging ends.
2023-12-10 16:35:40 +01:00
nanahi 5736737750 win32: stop fullscreen window from moving while dragging hack is active
The mouse down handler checks w32->current_fs to determine whether
to begin the dragging hack. Unfortunately, the w32->current_fs value
is stale, because the input is handled asynchronously, and we cannot
wait for an up-to-date value if dragging needs to be kept resonsive.

As a result, when the fullscreen state changes after the dragging
model loop is entered, the opposite value is used, so the window stays
draggable after entering fullscreen, and becomes undraggable after
exiting fullscreen.

With the resonsiveness and model loop constraints, the up-to-date
state must be queried inside WM_MOVING messages which are sent while
dragging. The message handler now checks if the dragging hack is active
while the window is in fullscreen, and overrides the new window position
with the current one, in effect prevents the window from being moved.

The old check is also removed, so the window is now draggable after
exiting fullscreen while dragging hack is active.
2023-12-10 16:35:40 +01:00
nanahi 5cc810e7f8 x11_common: fix compose key handling
Compose key doesn't function in X11 because XFilterEvent() isn't called,
and XNInputStyle is set to a wrong value. This results in KeyPress events
for the separate keyboard inputs in the compose key input sequence
instead of the composed character, making it impossible to input certain
characters which require compose key.

Fix this by calling the required XFilterEvent() and set XNInputStyle
to the correct value.
2023-12-10 14:55:41 +01:00