1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 17:12:36 +00:00
Commit Graph

52352 Commits

Author SHA1 Message Date
Dudemanguy
47f60d1c52 wayland: cap xdg_wm_base at 4 if wm_capabilities aren't supported
Fixes #13986.
2024-05-16 16:23:18 +00:00
Dudemanguy
d59f4fd3ec Revert "player: do not exit when a seek gets queued"
In various edge cases, this causes an assertion that was added later in
8816e1117e to be hit. The actual purpose
of the special case is not really clear. mp_seek already will change the
mpctx->stop_play value, so there shouldn't be any need to do it in
queue_seek. And it is known to cause problems so revert it. Also, remove
the special play direction logic that works around this behavior.
Fixes #13778.

This reverts commit dbdc46c97a.
2024-05-16 13:26:34 +00:00
sfan5
03ca340835 stream: remove directory playlist hint
The stream layer is the wrong place to handle this and the benefit
seems dubious.
2024-05-15 22:45:18 +02:00
sfan5
553fb024d4 stream: check file descriptor passed to fd:// or fdclose:// 2024-05-15 22:45:18 +02:00
sfan5
54c755b08d various: add missing checks for directory streams
All of this code opens a stream and expects to read stuff from a file.
But streams can also be directories and that has to be handled.
2024-05-15 22:45:18 +02:00
sfan5
b69b58a12a {options,player}: fix stream leaks 2024-05-15 22:45:18 +02:00
sfan5
ae23556b6f stream: disallow reading or writing to directories
Reading an entire file is a common operation, meanwhile
stream_file will happily open a directory. This doesn't match well.

Analogously for open_output_stream().
2024-05-15 22:45:18 +02:00
Kacper Michajłow
7a93a584fc fuzzer: add dedicated fuzzers for each demuxer
This will help drill deeper into specific code.
2024-05-15 20:09:54 +02:00
Kacper Michajłow
6ede789092 fuzzer_load: use memfd_create instead of real file
Should be slightly faster. Also fixes leaking temporary file on errors.
2024-05-15 20:09:54 +02:00
Kacper Michajłow
3c26389312 fuzzer_load: merge file and config load into one file
Removes code duplication. Add missing unlink while at it.
2024-05-15 20:09:54 +02:00
Kacper Michajłow
fd1c13f9b3 fuzzers: don't build binaries for disabled protocols
While there is a merit to test if disabled protocols doesn't crash or
something, such test can be made as simple unit tests, no fuzzing needed.
2024-05-15 20:09:54 +02:00
Kacper Michajłow
1f7c223749 av_common: fix integer overflow when adjusting timebase
Found by OSS-Fuzz.
2024-05-15 01:25:18 +02:00
Guido Cella
4d32db21c5 select.lua: strip brackets in select-subtitle-line 2024-05-13 16:36:27 +02:00
Guido Cella
61f72bd512 select.lua: add this script
This adds script messages to select playlist entries, tracks, chapters,
subtitle lines, bindings and properties using the newly introduced
mp.input.select().

This fully closes #13964.
2024-05-12 23:13:48 +02:00
Guido Cella
367a6b561a console.lua: close when pressing enter with input.select
When you select an item, due to the submit handler being called
asynchronously, the default item list is redrawn before the console
closes, which is jarring. Fix this by always closing the console as soon
as enter is pressed, as keeping it open is unlikely to be useful with a
fuzzy selector (unlike with input.get() where it can be used e.g. to
implement a Lua REPL). If desired we can later add a close_on_submit
flag defaulting to true.

Also fix a crash when pressing enter without any match.
2024-05-12 23:13:48 +02:00
Guido Cella
30fd3c1a96 console.lua: fix ctrl+f and ctrl+b keybindings
With mp.input.select() these keybindings were both scrolling and moving
the cursor because of how the condition was written and
handle_pgup()/handle_pgdown() not returning a truthy value.
2024-05-12 23:13:48 +02:00
Guido Cella
1ebe11d06f console.lua: don't crash when scrolling without matches
selected_match can become 0 when pressing certain scrolling
keybindings without any match, and

for i = first_match_to_print, last_match_to_print do

in populate_log_with_matches() runs from 0 to 0 and accessing
matches[0].text crashes console.lua. Return early when it is 0.
2024-05-12 23:13:48 +02:00
Guido Cella
9d75289ced console.lua: truncate lines longer than the maximum width
Avoid messing up the max_log_lines calculation when mp.input.select() is
called with very long items.

This doesn't work with Japanese characters because they are bigger.
2024-05-12 23:13:48 +02:00
Guido Cella
eb4c6be630 console.lua: don't convert integers for mp.input to string
I misunderstood CogentRedTester's review in
https://github.com/mpv-player/mpv/pull/10282#discussion_r1428972352 as
referring to the cursor_position in mp.input's arguments instead of the
one received by the closed callback.

The cursor_position passed to input.get doesn't need to be converted to
a number because it was already JSON, while the cursor_position received
by the closed callback is currently a string, and we need to pass JSON
in input-event script messages to keep it as an integer to work around
mpv converting integer script message arguments to string.

This is more noticeable after implementing mp.input.select(): its submit
argument currently receives the selected index as a string, and this
makes Lua error if you use it as an index of a numerical table, e.g.:

submit = function (id)
    mp.set_property(property, tracks[tonumber(id)].selected and "no"
                              or tracks[tonumber(id)].id)
    ...
end,

This commit avoids having to call tonumber(id).
2024-05-12 23:13:48 +02:00
Guido Cella
994a08f5a7 input: fix builtin sequence bindings
If g-p is a builtin binding and p is bound in input.conf, pressing g-p
triggers the p binding. Fix this by searching for builtin bindings that
match a longer key sequence even after a user-defined binding has been
found.

Even after changing the condition from >= to > bindings of the same key
defined later in input.conf are still preferred over earlier ones,
because bind_keys() overwrites duplicate bindings. Bindings defined by
later mp.add_key_binding calls are also still preferred.
2024-05-12 23:13:48 +02:00
Guido Cella
e6af31dc0c console.lua: implement a command parser to complete more things
This allows more completions than patterns:

Both single and double quotes are recognized.
Quotes around the first token are recognized.
Command prefixes are recognized.
Choice options are completed after change-list/vf/af add/append/pre/set.
File paths are completed after set/cycle-values/change-list with options
that expect files, including cycling between paths with spaces, e.g.
cycle-values glsl-shaders 'foo bar' 'baz qux'.
File paths are completed in the fourth argument of dump-cache.
Items that have been set are completed after change-list remove.
2024-05-12 22:29:40 +02:00
Guido Cella
c4b03700e1 player: add option-info/<name>/expects-file
This will allow console.lua to complete files after e.g. set
glsl-shaders <Tab>.
2024-05-12 22:29:40 +02:00
Guido Cella
4e5845ad03 osc.lua: remove scaleforcedwindow
This is unused since 4e013afd37 because the mpv logo and the "Drop files
or URLs to play here." message are shown instead of the OSC controls. It
has the adverse affect of making the OSC twice as big when playing
videos with --lavfi-complex, because that makes the video property which
osc.lua checks unavailable.
2024-05-12 21:00:38 +02:00
Kacper Michajłow
f220f0fb89 autocrop.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
e5e17c80ba ytdl_hook.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
f348a8b303 stats.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
8fa0e09b27 osc.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
e17546333a options.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
fe488151dc defaults.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
5e77d3b640 console.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
1831c548db auto_profiles.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
c5c5a5a2ad test-hooks.lua: fix variable shadowing warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow
c431b532b8 status-line.lua: fix unused variable warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow
0f7aab534a skip-logo.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
885cc30596 pause-when-minimize.lua: fix unused variable warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow
b927857d03 ontop-playback.lua: fix unused variable warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow
50c4b2cd4c observe-all.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
16c19445bc cycle-deinterlace-pullup.lua: fix unused variable warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow
e47d768d51 command-test.lua: fix some lint warnings
Fixes unused variable warnings.
2024-05-12 20:06:39 +02:00
Kacper Michajłow
a1caa00187 autoload.lua: fix some lint warnings
Fixes:

autoload.lua:201:1: setting undefined field filter of global table
autoload.lua:209:1: setting undefined field append of global table
autoload.lua:322:11: value assigned to variable extensions is unused
2024-05-12 20:06:39 +02:00
Kacper Michajłow
b4fcf7d248 autodeint.lua: fix some lint warnings
Fixes:

autodeint.lua:90:1: right side of assignment has more values than left
side expects
2024-05-12 20:06:39 +02:00
Kacper Michajłow
fabc92453f audio-hotplug-test.lua: fix some lint warnings
Fixes:

audio-hotplug-test.lua:1:7: unused variable utils
audio-hotplug-test.lua:3:61: unused argument name
audio-hotplug-test.lua:5:9: unused loop variable index
2024-05-12 20:06:39 +02:00
Kacper Michajłow
71d9c31394 acompressor.lua: break long lines 2024-05-12 20:06:39 +02:00
Kacper Michajłow
0084fbd458 github/workflows: add lua linting 2024-05-12 20:06:39 +02:00
sfan5
a33fd3b4cf Revert "stream: don't try to read from all-sparse/no-data files"
The stream layer is just not the right place to make this change
since it's also used for completely unrelated purposes such as reading
configs.

This reverts commit bb7a485c09.
2024-05-12 18:06:21 +02:00
Kacper Michajłow
21e167cc6a vf_vapoursynth: pass image properties from input
This might not always be correct depending on filtering done in VS. But
unless VS send us all the metadata we have to get it from somewhere.

Fixes dynamic frame metadata, which was copied from fmt_in, initialized
only upon reinitialization.

Fixes crashes caused by the use of stale pointers.

Fixes: #13956
2024-05-12 17:56:53 +02:00
Kacper Michajłow
83e51a82e6 vf_vapoursynth: fix _ChromaLocation 2024-05-12 17:56:53 +02:00
Kacper Michajłow
3874145248 hwdec_cuda_vk: add missing io.h include
Fixes compilation on Windows with cuda enabled.
2024-05-11 21:34:24 +02:00
Kacper Michajłow
552c4552a2 audio: report EOF also for untimed AO mode 2024-05-10 23:56:56 +02:00
Guido Cella
aa067f5984 console.lua: increase margins from the bottom-left corner
console.lua is too close to the left and bottom of the OSD IMO. Make the
margins a bit bigger.
2024-05-10 22:57:44 +02:00