0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00
Commit Graph

3674 Commits

Author SHA1 Message Date
Guido Cella
e3eeaec813 select.lua: don't use add_forced_key_binding
There's no advantage in using the forced version here. It is a leftover
from when this was an external script and forced was necessary to bind
key sequences reliably until 3f83671f20.
2024-09-19 13:57:39 +00:00
llyyr
140196f297 ytdl_hook: fix typo (chapters -> chapter)
Fixes: ec966fb866
2024-09-19 13:55:58 +00:00
Guido Cella
030c283ef5 console.lua: respect --video-osd=no 2024-09-15 18:27:24 +02:00
Guido Cella
8592206c75 console.lua: truncate more characters with --msg-module and --msg-time
Fix the terminal width calculation for the select menu with these
options.
2024-09-15 18:27:24 +02:00
Guido Cella
b98d4fde0d console.lua: fix highlighting the selected item with --msg-module
With --msg-module the select menu also highlights the "statusline" on
the next line. Fix this by resetting the color before \n instead of
after it.

This requires changing all log code to not preemptively add a newline,
which is actually simpler, though we have to modify the messages
received with log-message which already contain a newline.
2024-09-15 18:27:24 +02:00
nanahi
42b40d03f1 player/main: revert msg uninit order changes
msg must be the last module to uninit since pretty much
everything else uses logging.

This reverts commit f92d5da89c.
This reverts commit c1282d4d43.
2024-09-15 17:03:33 +02:00
Kacper Michajłow
a6e13f41eb console.lua: sync colors after msg.c change
Keep ASS pallete the same, as it doesn't print trace messages anyway.
Remove only bold and keep debug gray.
2024-09-14 17:11:07 +02:00
Guido Cella
7362f72fdf console.lua: fix completing empty --dscale and --cscale
These options accept an empty value within their choices. If the user
didn't add manually input a quote before completing them, add quotes
automatically so that the blank value can actually be used.
2024-09-14 17:06:07 +02:00
llyyr
ec966fb866 ytdl_hook: add some more yt-dlp tags
These might be useful
2024-09-14 14:07:54 +02:00
Oneric
5357d18fe6 sub: add ass-video-aspect-override option
It is unclear whether there actually is any usecase for this option
which isn't better served by sub-ass-use-video-data and/or LayoutRes
overrides, but prior to the introduction of sub-ass-use-video-data
it was possible to pass along storage resolution while faking an
aspect ratio of 1:1.
sub-ass-video-aspect-override=1 combined with sub-ass-use-video-data=all
now makes this possible again.

The uper limit of a 10:1 aspect matches
the general video-aspect-override option.
2024-09-13 23:24:08 +02:00
Oneric
207b1a2c91 sub: merge vsfilter-aspect and vsfilter-blur-compat options
The naming for "blur-compat" was misleading since the setting
actually affects more than just blur affects. Additionally
forwarding storage resolution but forcing an aspect ratio
of 1.0 for the video is likely to result in odd rendering
and there’s no known usecase for it.

Both options control which video properties are exposed to libass
so to fix the aforementioned issues merge these settings into one
tri-state sub-ass-use-video-data.

The default V keybind now cycles through all states of
use-video-data instead of toggling vsfilter-aspect-compat.

Resolves: https://github.com/mpv-player/mpv/issues/10680
2024-09-13 23:24:08 +02:00
Kacper Michajłow
5edc8973eb various: use talloc_replace 2024-09-08 17:33:27 +02:00
Kacper Michajłow
e7f153db58 stats.lua: don't use ASS tags when use_ass is false
Fixes terminal output.
2024-09-08 17:33:03 +02:00
nanahi
f92d5da89c player/main: uninit input after terminal uninit
The terminal input thread holds the input_ctx reference.
Fixes: c1282d4d43
2024-09-08 17:14:37 +02:00
nanahi
f02b8bc9fd stats.lua: fix text size/alignment for key bindings page
After a subject line, the text style needs to be reset to make
sure that key binding lines have correct size and alignment
while scrolling the page.
2024-09-05 14:06:05 +02:00
Guido Cella
7c672e33a5 command: expand ~ paths in load-config-file
Fixes #14766.
2024-08-30 18:54:37 +02:00
Kacper Michajłow
938938a985 fuzzer_options_parser: add options parser fuzzing
To improve coverage of parse_commandline.c
2024-08-27 01:31:40 +02:00
Guido Cella
64a0e31aa9 console.lua: pre-filter searched commands if the line is filled
If you type something before pressing Ctrl+r, filter the commands
containing the typed line.

fuzzy_find() is modified to not code a separate case when the line is
empty in both handle_edit() or search_history().
2024-08-24 03:14:04 +02:00
verygoodlee
e3a9ce22f9 console.lua: add numpad + - * / keybindings
numpad + - * / was remapped to KP_ADD/KP_SUBTRACT/KP_MULTIPLY/KP_DIVIDE in #14660
2024-08-21 14:31:01 +02:00
Guido Cella
ebc14a58ae console.lua: implement history search 2024-08-16 18:32:58 +02:00
Kacper Michajłow
9978cb821d player/loadfile: don't clear watch later for auto playlist parent file
Fixes: https://github.com/mpv-player/mpv/pull/14555#issuecomment-2282338707
2024-08-11 21:06:13 +02:00
Kacper Michajłow
ff1f8baecd common/playlist: add playlist_set_current() 2024-08-10 23:27:40 +02:00
Kacper Michajłow
73b58722e7 player/misc: add str_in_list() and use it 2024-08-10 23:27:40 +02:00
Kacper Michajłow
44a3a3293f options: add --{video,audio,image}-exts 2024-08-10 23:27:40 +02:00
Kacper Michajłow
4f1e9e34c3 demux_playlist: add --directory-filter-types 2024-08-10 23:27:40 +02:00
Kacper Michajłow
c54ad6933b demux_playlist: add --autocreate-playlist-{video,audio,image}-exts 2024-08-10 23:27:40 +02:00
Kacper Michajłow
bb9b862f0c demux: add --autocreate-playlist 2024-08-10 23:27:40 +02:00
Mike Will
88885c0401 audio: add pitch-shifting feature
Uses resampling in tandem with a time-stretching audio filter to
change the audio's pitch while leaving its tempo intact.
2024-08-07 22:56:17 +02:00
nanahi
0818f6001c console.lua: guard user-data/osc/margins value
Defaults margins to 0 if an external script sets this to an invalid value.
2024-08-06 20:28:44 +02:00
Guido Cella
ee05804bfa {osc,select}.lua: show playlist entries with trailing /
If a playlist entry ends with a slash these scripts only show the
basename which is empty. Fix this by stripping trailing slashes so that
the last directory component becomes the basename.
2024-08-06 20:27:33 +02:00
Kacper Michajłow
ec40dcca9b loadfile: fix relative file open exclusion for fuzzing 2024-08-04 21:33:36 +02:00
Guido Cella
5f768a688b loadfile,select.lua: print only one bitrate
Print demux-bitrate if available, else hls-bitrate, not both (as
demux-bitrate is generally more reliable). This avoids printing "HLS
kbps" which looks weird.

Fixes
https://github.com/mpv-player/mpv/pull/14453#discussion_r1700550385
2024-08-02 08:41:43 +02:00
llyyr
11ed012c34 player/audio: invert audio_started boolean
Waiting for audio_started to be set to true takes too long which causes
us to miss it for the first frame, instead invert the condition so it's
set on the first frame.

Fixes #14615
2024-08-01 11:45:13 +00:00
Kacper Michajłow
5fed12e025 win32: add Media Control support
Add support for SystemMediaTransportControls interface. This allows to
control mpv from Windows media control ui.
2024-07-29 21:38:19 +02:00
nanahi
fc6aa2cc8a player/scripting: remove outdated comment about posix_spawn
The comment was added in e2ab6b7f35,
but posix_spawn usage was removed in 5309497727
to ensure CLOEXEC correctness.
2024-07-29 21:00:48 +02:00
Guido Cella
544240c829 player/command: fix --force-window=yes acting like immediate
player/main.c runs all option callbacks with a flag on init, so since
a5937ac7e3 which added UPDATE_VO, if --force-window=yes is passed, the
VO is immediately initialized, as if --force-window=immediate was
passed. Fix this by not running the UPDATE_VO code when there is no
video output.
2024-07-29 01:46:21 +00:00
Guido Cella
6107112b32 player: don't decrement --ab-loop-count=N and add remaining-ab-loops
Follow up to the previous commit. Stop decreasing --ab-loop-count=N on
each iteration so it is preserved across different loops. In particular
it is preserved between different files without adding it to
--reset-on-next-file. Add a property to expose the remaning A-B loop
count instead.

The current behavior of --ab-loop-count=N is even worse than --loop-file
since it also doesn't reset when defining a new A-B loop in the same
file. Defining it has no effect after --ab-loop-count has decreased to
0, and this can't be fixed by adding it to --reset-on-next-file. This
commit also resets remaining-ab-loops every time --ab-loop-a and
--ab-loop-b are set to fix this.
2024-07-26 20:09:19 +02:00
Guido Cella
f411f3145b player: don't decrement --loop-file=N and add remaining-file-loops
This stops decreasing numerical values of --loop-file on each iteration
so that loop-file=N loops every playlist entry without having to add
--loop-file to --reset-on-next-file.

The current behavior confuses users as seen in:

https://github.com/mpv-player/mpv/issues/2481
https://github.com/mpv-player/mpv/issues/5943
https://github.com/mpv-player/mpv/issues/11291
https://github.com/mpv-player/mpv/issues/13860
https://www.reddit.com/r/mpv/comments/rcwnrw/looping_each_file_n_times_in_a_playlist/

Also options are supposed to reflect the value configured by the user
and not change on their own.

A remaining-file-loops property is exposed as a replacement to check how
many loops are left.
2024-07-26 20:09:19 +02:00
Kacper Michajłow
397212ae15 player: remove empty line from --help
Follow-up after 127b6a3455.
2024-07-26 20:07:30 +02:00
Guido Cella
a5937ac7e3 m_option: add UPDATE_VO flag
This will allow reiniting the VO when more options are changed without
hardcoding them in options.c

Also reinit the VO when changing --gpu-debug and --gpu-sw.
2024-07-24 18:44:41 +00:00
Guido Cella
d384a6b793 external_files: allow specifying --cover-art-whitelist filenames
Fixes https://github.com/mpv-player/mpv/discussions/14520.
2024-07-23 14:12:11 +00:00
Guido Cella
8110bdac6d command: remove deprecated packet-*-bitrate properties
These have been deprecated for 9 years so it's fine to remove them.

Using the replacement properties like video-bitrate in stats.lua will
convert big enough bitrates to Mbps.
2024-07-18 22:52:35 +02:00
Guido Cella
5f8ac5b862 loadfile,select.lua: print bitrates of tracks 2024-07-18 22:52:35 +02:00
Guido Cella
7bcd525dce various: sync shown track flags
Show the same flags in loadfile.c, select.lua and stats.lua. The only
differences are that only stats.lua prints both image and albumart
because it's supposed to show detailed track information, and select.lua
prints the image flag because pressing g-v doesn't show Video or Image
like in loadfile.c and stats.lua.
2024-07-18 22:52:35 +02:00
Guido Cella
2fd88ffbae various: print Image instead or Video for image tracks
Fixes #8561.
2024-07-18 22:52:35 +02:00
nanahi
21df853624 osc.lua: don't hide osc when touch is active
This lets touch events activate a separate timeout for osc hiding so that
the osc only hides when both mouse and touch timeout are expired.
This is the general expectation with touchscreen UI, and also fixes
platforms which reset the mouse position when all fingers leave the
touchscreen (e.g. sway).
2024-07-18 22:49:51 +02:00
llyyr
127b6a3455 player: remove empty line from --version 2024-07-18 22:49:28 +02:00
nanahi
58f3009b80 playloop: move run_command_opts to command_event for playback-restart 2024-07-17 18:28:56 +00:00
nanahi
503a896d1a command: run input commands after idle state is ready
This makes sure that commands like show-text update the osd properly
with --idle=yes.
2024-07-17 18:28:56 +00:00
Kacper Michajłow
607ad8943b player/command: don't return ill-formed node if there is no default val
option-info/<name>/default-value would be initialized with zeroed
object, which is not valid for string typed options, as the would be set
to NULL.

Found by OSS-Fuzz.
2024-07-16 22:59:23 +02:00