Commit Graph
100 Commits
Author SHA1 Message Date
Guido Cella 9dbf5d681d misc/path_utils: rename bstr_strip_ext() to mp_strip_ext() 2026-06-27 21:43:18 +02:00
Guido Cella 089c172dff misc/path_utils: rename bstr_get_ext() to mp_get_ext() 2026-06-27 21:43:18 +02:00
Guido Cella 4fa3c38983 misc/path_utils: remove mp_splitext()
It is no longer used.
2026-06-27 21:43:18 +02:00
Guido Cella 1a09154988 various: replace mp_splitext() with bstr_get_ext()
This will allow removing mp_splitext().
2026-06-27 21:43:18 +02:00
Guido Cella 9ffc0cd861 misc/path_utils: remove mp_strip_ext()
It is no longer used.
2026-06-27 21:43:18 +02:00
Guido Cella df3b76b018 various: replace mp_strip_ext() with bstr_strip_ext()
This will allow removing mp_strip_ext().
2026-06-27 21:43:18 +02:00
Guido Cella 2057e34f45 misc/path_utils: make bstr_strip_ext() and bstr_get_ext() accurate
Move bstr_strip_ext() and bstr_get_ext() to path_utils.c making them use
split_ext(), which is better than the previous bstr.c implementation
because it doesn't consider . in the dirname or at the start of
basenames.
2026-06-27 21:43:18 +02:00
Guido Cella 381e7eb155 misc/path_utils: add split_ext()
This will be used by bstr_get_ext() and bstr_strip_ext() without
allocating memory.
2026-06-27 21:43:18 +02:00
Guido Cella 4eaef66f4c bstr: don't make bstr_splice() add to NULL
If str.start is NULL, don't error on FreeBSD + ASan with "applying zero
offset to null pointer" in bstr_splice().

This will avoid an error in split_ext() in the language test with NULL
as argument.
2026-06-27 21:43:18 +02:00
Guido Cella 29c26b5bc5 misc/path_utils: add mp_basename_bstr()
This will be used by bstr_get_ext() and bstr_split_ext() without
allocating memory.
2026-06-27 21:43:18 +02:00
Guido Cella 9bfdb3d67f vo_gpu{,_next}: use bstr_strip_ext()
Because it is simpler than mp_splitext(), and will allow removing
mp_splitext().
2026-06-27 21:43:18 +02:00
Guido Cella 351291d583 menu.conf: compare aspect overrides more strictly
Fixes #18152.
2026-06-27 18:04:48 +02:00
Guido Cella 1bcc17a7be select.lua: fix selecting the default subtitle line
Fixes 53796ca2ea.
2026-06-21 20:34:00 +02:00
Guido Cella 02491a3949 osc.lua: don't reinit on duration changes
It can be avoided by extracting just the code to update the seekbar and
its chapter markers. This avoids log spam and is more efficient for DVD
and Blu-ray menus which continously update duration and have chapter
markers.

The livemarkers option is removed since updating the chapter markers is
no longer expensive like reiniting.
2026-06-17 13:39:10 +00:00
Guido Cella 715d2b7cf2 DOCS/man/commands: rename COMMANDS to CONSOLE COMMANDS
Avoid confusing it with command interface.
2026-06-17 13:38:57 +00:00
Guido Cella cab6fbe222 context_menu.lua: don't open disabled submenus on hover
A menu item can have a non-empty submenu but still be disabled. This is
the case for mkvs with a single edition. Don't open the submenu on hover
in that case.
2026-06-16 13:02:52 +02:00
Guido Cella 6eaf35866c command: add support for printing sub-lines
show-text ${sub-lines} can be used to print subtitle lines around the
current one and have them hide automatically.
2026-05-20 23:21:49 +02:00
Guido Cella 3d111fbf1e demux_libarchive: apply --directory-filter-types to files in archives
Fixes #17931.
2026-05-20 23:15:44 +02:00
Guido Cella 631cdd3622 select.lua: preserve empty subtitle lines
Fixes e9fbf49466.
2026-05-13 15:43:38 +02:00
Guido Cella aa57714b63 video: merge the tiles of grid heif and avif images
Fixes #13585.
Fixes #14982.
Fixes #16486.
2026-05-13 14:55:48 +02:00
Guido Cella 7732c305a5 osc.lua: hide 0 duration
Restore the behavior before 3183ea99.
2026-05-12 00:06:35 +02:00
Guido Cella 8674222927 input.conf: make rotate keybindings repeatable
Needed because --video-rotate is OPT_CHOICE.
2026-05-10 20:46:31 +02:00
Guido Cella e9fbf49466 select.lua: split multi-line subtitles
Before 77ed8fef88 texts with multiple lines were split to multiple
items, after it only shows the text before any newline.

Split lines again.
2026-05-09 09:56:13 +02:00
Guido Cella 0a0c63d3e9 ytdl_hook.lua: convert metadata values to string
Fixes https://github.com/mpv-player/mpv/pull/17805#issuecomment-4340090625
2026-04-29 11:32:19 +02:00
Guido Cella 05b327c723 osc.lua: use the cached chapter_list instead or retrieving chapters 2026-04-26 08:56:24 +02:00
Guido Cella ae3189567b select.lua: add select-secondary-subtitle-line
Requested in https://github.com/mpv-player/mpv/pull/17730#issuecomment-4321224996
2026-04-26 08:55:42 +02:00
Guido Cella 3183ea9980 osc.lua: always observe duration
Currently the duration observer is toggled in multiple places to not
call request_init unecessarily. It is much simpler to always observe it
and call request_init conditionally in the callback. This also allows
reusing the cached value throughout the OSC.

Note that dividing by 0 is not an error in Lua so there is no need to
check for both 0 and nil.
2026-04-26 00:20:33 +02:00
Guido Cella 9ce79bcaa0 osc.lua: hide thumbnails when setting visibility to never
And also when using script-message osc-hide.
2026-04-25 20:03:10 +02:00
Guido Cella 47a8a47b31 osc.lua: don't write to user-data on every render
Only update hover-sec when there is a big enough change to not spam the
log with -v.
2026-04-25 20:03:10 +02:00
Guido Cella 77ed8fef88 select.lua: use sub-lines instead of forking to ffmpeg
This:

- Removes the dependency of ffmpeg in PATH - useful on Windows, macOS
  (?), Flatpak.
- Will support subrandr.
- Avoids redownloading network subtitles.
- Avoids slow demuxing of large mkvs.
- But no longer returns future lines of embedded subtitles.
- No longer returns embedded lines of regions you seeked beyond without
  playing them.
- Changing sub track drops cached subtitles.
2026-04-25 19:58:52 +02:00
Guido Cella 5f02e1b8a2 sub: add sub-lines property
Return all subtitle lines in memory with text, start and end.

I did not name this sub-all so it cannot be misinterpreted as referring
to all subtitle tracks.

Closes #12810.
2026-04-25 19:58:52 +02:00
Guido Cella e046cd0736 context_menu.lua: add background_alpha script-opt
Closes #17807.
2026-04-24 20:19:50 +02:00
Guido Cella 98a6960a3d ytdl_hook.lua: remove outdated comment 2026-04-23 22:06:47 +02:00
Guido Cella b3c46456c5 ytdl_hook.lua: set metadata with use_manifests=yes
With use_manifests=yes EDL is not used so metadata never gets set
through the tags mechanism. Thankfully the metadata property was
recently made writable so use that instead.

The existing metadata variable is inlined to fix linting.

Fixes https://github.com/mpv-player/mpv/pull/17761#issuecomment-4306070651
2026-04-23 22:06:47 +02:00
Guido Cella 35b851e38a DOCS/man/options: remove all_formats=yes warning
Dunno what wm4 was referring to here but all_formats=yes works just fine
and quickly for changing track at runtime. The only issue I see is that
it drops the video cache if you change audio track.
2026-04-21 22:50:12 +02:00
Guido Cella 6b524c4f0e ytdl_hook.lua: default to all_formats=yes
93fe7a5526 fixed the only problem with all_formats=yes, so make it the
default to allow changing tracks of ytdl_hook URLs at runtime without
re-invoking yt-dlp.

Closes #16872.
2026-04-21 22:50:12 +02:00
Guido Cella 5921fe50bb osc.lua: use the cached chapter-list for chapter markers
When 0197729949 added state.chapter_list this call was not updated to
use the cached value, but there is no reason not to use it, especially
now that more cached properties are used.
2026-04-20 21:57:05 +02:00
Guido Cella fb8c933d4d osc.lua: cache observed properties
For properties that were already being observed but still retrieved over
and over, cache their values using the new observe_cached().

osd-dimensions observer said that if cached we may have to worry about
property ordering but it seems to work fine. It is nice to cache it
because it was the property retrieved the most frequently, in 5
different places.
2026-04-20 21:53:57 +02:00
Guido Cella 06f4ce75aa defaults.lua: remove mp.use_suspend dead code
This does nothing since f30c5d09f4 (10 years ago).
2026-04-18 23:28:57 +02:00
Guido Cella 8f66c0982f command: log menu-data changes at trace level instead of verbose
Avoid spamming the log.
2026-04-18 17:45:03 +02:00
Guido Cella 0b2c08ba8d osc.lua: show the first selected audio track id with --lavfi-complex
Similar to current-tracks, when the selected audio track is combined
with another one or with an ffmpeg filter, show the first selected track
id instead of "-".

This was requested by a user on IRC.

Also avoid fetching aid and sid on each render.
2026-04-18 17:41:54 +02:00
Guido Cella 8da99f778f osc.lua: set no_video correctly
Fixes f4197a5ce0.
2026-04-17 20:28:42 +02:00
Guido Cella f4197a5ce0 osc.lua: merge the current-tracks/video observer into track-list's
Reuse the new track-list observer callback to check whether there is a
video track.
2026-04-17 20:19:28 +02:00
Guido Cella 15e5af0868 osc.lua: add observe_cached() helper
This removes code repetition and will make caching more properties
easier.

Some state fields are renamed to have the same name as the property.
2026-04-17 20:05:46 +02:00
Guido Cella 021b5ccf23 ytdl_hook.lua: set the title in metadata
93fe7a5526 made global_tags work with all_formats=yes, so do like
suggested in 8ea7aa5471 and set the title via tags.

This makes available in ${metadata/title}, even if you set
--force-media-title separately.

--force-media-title is also set when self_redirecting_url is true, but
tags seem not to be set in this case and I don't know where to find such
videos to test. It was originally added to close #5313, but the URL
linked there no longer loads.
2026-04-17 19:56:06 +02:00
Guido Cella aec426a4d8 context_menu.lua: set user-data/mpv/context-menu/open
Closes #17428.
2026-04-17 19:46:12 +02:00
Guido Cella f4dcd295cf demux_edl: support global_tags with delay_open
The delay_open mechanism used by
--script-opt=ytdl_hook-all_formats=yes breaks setting metadata with
global_tags because tl->track_layout is NULL. See adcf51dccd cbb8f534b0
8ea7aa5471.

Fix this by applying tags to the EDL timeline in this case.

Tags must still be applied to tl->track_layout when available for them
to work with local EDL files.
2026-04-17 19:24:47 +02:00
Guido Cella e0f54adf08 menu.conf: add OSC layout selection
Make this feature discoverable.
2026-04-17 18:34:24 +02:00
Guido Cella e6a338a98a options.lua: stop searching in lua-settings
This has been deprecated for 8 years, since 9eadc068fa, with a visible
warning. Removing it has the benefit of not spamming every log file with
lua-settings searches.
2026-04-17 18:33:35 +02:00
Guido Cella 18f83bc43e osc.lua: make buttons clickable from the horizontal edges
Since changing the width and alignment of buttons shrinks them or messes
up the layout, manually override the hitbox of buttons at the edges.

Fixes #9791.
2026-04-17 18:33:11 +02:00
Guido Cella ec4d50fd91 context_menu.lua: enable runtime script-opt updates
Fixes #17726.
2026-04-09 13:40:37 +02:00
Guido Cella 266cb79f38 osc.lua: make all the height of bar lines clickable
There is an area between the 2 lines of bottombar and topbar that is not
clickable, e.g. between the menu and play_pause icons. Make it all
clickable so it's easier to click buttons.

This also allows clicking from the bottom in slimbottombar and from the
top in topbottombar.
2026-04-08 20:32:48 +02:00
Guido Cella c9d2f17a98 osc.lua: allow clicking window controls from the top
Window controls are not clickable from the very top of the window, they
have a margin to the top that makes them harder to click. Make them
clickable also from the very top to make them easier to activate.

The close button with the default windowcontrols_alignment=right
specifically is already clickable from the rightmost part of the window.

Partial fix of #9791 (other buttons also need to be updated).
2026-04-08 20:32:48 +02:00
Guido Cella b8df71a411 commands.lua: use the new choices field in command-list
Use the choices field added by ae2384bce0 for command arguments instead
of hardcoding them.
2026-04-06 18:24:30 +02:00
Guido Cella c961c96afb lua: remove the deprecated error field from end-file
This has been deprecated for 6 years so remove the compatibility code.

This basically reverts 37f441d61b.
2026-04-01 22:10:08 +00:00
Guido Cella 70b8b22c8b command: remove the deprecated time-start property
This has been deprecated for 11 years since 70df1608d6 so remove it. All
it does is return 0.
2026-04-01 22:09:25 +00:00
Guido Cella ea40f07d2d DOCS/interface-changes: add newline at end of file 2026-04-01 16:47:26 +02:00
Guido Cella 9465b30a40 DOCS: remove behavior changes before version 0.38
These are ancient and not useful anymore.

The version notices are kept under:
overlay-add: handled by #17520
end-file's file_error: the notice should be removed when updating error
field like suggested there
time-start: this should just be removed
~/.mpv/: needed to understand why this is used
--aid: needed to understand the following paragraphs
2026-03-30 15:09:38 +00:00
Guido Cella 1a545faf28 menu.conf: don't check Hardware decoding with no video track 2026-03-25 13:44:44 +01:00
Guido Cella ad9374d03e osc.lua: move {audio,sub}_track_count into state 2026-03-12 15:58:21 +01:00
Guido Cella 6da164452a osc.lua: update track state only when track-list changes
There is no need to retrieve track-list on every osc_init().

Also remove the outdated comment.
2026-03-12 15:58:21 +01:00
Guido Cella 44dec05a29 osc.lua: don't retrieve display-fps at startup
There is no advantage since is it never available at startup, so speed
up the startup by not retrieving it.
2026-03-11 14:58:09 +01:00
Guido Cella a9ac97a5b0 DOCS/man/lua: remove REPL reference
It is a leftover of the original repl.lua name. Follow up to 9551de6385.
2026-03-04 14:11:16 +01:00
Guido Cella af9c81fa1e DOCS/man/options: don't recommend --sub-justify=left
It is unclear why this should be recommended. If it were recommended it
would be the default. The consensus is that centered justification looks
better.
2026-03-01 08:24:39 +01:00
Guido Cella 05fac7f21e DOCS/man/lua: document remaining input.select() fields
Document more shared fields with input.get().

I originally omitted them because they didn't seem useful for
input.select(), but now opened can be used to override keybindings, and
default_text = "'" can be used to default to exact search (which I do
for history in my build).

closed, default_text and cursor_position may be used to remember the
last input line for the next call.
2026-02-28 22:41:26 +01:00
Guido Cella 850677c157 input.lua: don't shadow the global type() function
For consistency, also rename type to event in defaults.js.
2026-02-27 18:12:52 +01:00
Guido Cella 3ec435dbee menu.conf: add a Reload menu item 2026-02-27 09:24:53 +01:00
Guido Cella 06259d1a0b input.conf: bind Ctrl+r to reload the current file
Because how to do this has been asked more than 10 times in #mpv, bind
it by default.
2026-02-27 09:24:53 +01:00
Guido Cella 3b555c349c command: let playlist-play-index current preserve file-local-options
If you set file-local-options/foo at runtime and run playlist-play-index
current or playlist-play-index $current_pos, file-local-options/foo is
reset. Add a flag to make it preserve file-local-options.

The advantage of this change is that it allows binding Ctrl+r set
file-local-options/start ${=time-pos}; playlist-play-index current yes
to reload the current file while preserving all options, independently
of --no-config, --watch-later-options or --reset-on-next-file, and
without writing watch later files to disk. It also preserves
file-local-options set on the CLI unlike loadfile.
2026-02-27 09:21:14 +01:00
Guido Cella ee9a219600 console.lua: deduplicate code between get-input and handle_cursor_move 2026-02-23 17:40:11 +01:00
Guido Cella aa82213726 select.lua: don't set an empty prompt
Not needed since 44816ef8ff.
2026-02-15 16:36:28 +01:00
Guido Cella 102e693f49 select.lua: sort the track submenu
track-list doesn't necessarily return tracks sorted by type so we need
to sort them ourselves.
2026-02-14 01:07:27 +01:00
Guido Cella 1f686769cd mp.input: deprecate log_error()
This was a mistake. It's too situational and it's not worth complicating
the API and every mp.input client with it. It made some sense before I
implemented input.select() because you could use input.get() to input a
choice and validate it, but in general for input.get() clients it's
better to show an error with input.set_log() instead of adding new lines
to the log everytime. This is what e.g.
https://framagit.org/Midgard/mpv-subber/-/blob/master/subber.lua does.

So this is only marginally useful for REPL scripts that keep adding
lines to the log, and the only such scripts are commands.lua and my
lua-repl.lua. commands.lua never used it and I already removed it from
lua-repl.lua. Cloning all scripts in the wiki reveals that **nobody** is
using log_error(), confirming that it is safe to deprecate.
2026-02-08 11:51:17 +01:00
Guido Cella ea82915ba7 menu.conf: change duplicate hints
Deduplicate:
Op&en and &Editions/Titles
&Quit and &Quit watch later
2026-02-03 21:05:38 +01:00
Guido Cella d6eeff690d select.lua: handle empty lines at the end of the file
Prevent a crash in this case due to lines[i + 1] being nil.
2026-01-31 14:26:04 +01:00
Guido Cella a0f593202a select.lua: handle carriage returns in menu.conf
Fixes https://github.com/mpv-player/mpv/pull/16816#issuecomment-3804029038
2026-01-31 14:26:04 +01:00
Guido Cella 2cef09820d context_menu.lua: apply disabled_color to separators
As per Samillion's suggestion, reduce the contrast between separators
and the background to match other context menus. Using the already
defined disabled_color works for this and seems to be what GTK and Qt
do at a glance.
2026-01-31 13:20:05 +01:00
Guido Cella 01cb6433c0 select.lua: always observe --osd-playlist-entry
The playlist submenu does not update in this edge case:

- Have a playlist-count > 99 on the first vo-configured. This makes
  playlist() return before observing --osd-playlist-entry.
- Remove playlist entries until the count is < 100
- Change --osd-playlist-entry
- Show the playlist submenu before changing the playlist
2026-01-30 10:53:19 +01:00
Guido Cella d79172ac3e select.lua: update the playlist submenu after playlist-move
Observing playlist-pos and playlist-count is not enough to update it
after playlist-move, but we can observe any playlist property with type
none to get notified of every MP_EVENT_CHANGE_PLAYLIST, even if the
property has not changed.

This is similar to the
mp.observe_property("vsync-jitter", "none", recorder) hack used by
stats.lua to replicate the deprecated tick event.

Fixes https://github.com/mpv-player/mpv/pull/16816#discussion_r2727498518
2026-01-28 15:21:38 +01:00
Guido Cella d1743b641b menu.conf: change duplicate hints
Deduplicate:
&Properties and Copy &path
C&enter and D&einterlace
&Speed and &Shuffle
2026-01-26 11:47:16 +01:00
Guido Cella eadba4469f menu.conf: add open-chat to the context menu 2026-01-26 11:11:38 +01:00
Guido Cella d7f0efb67b context_menu.lua: make ESC close only submenus when they are open
Fixes https://github.com/mpv-player/mpv/pull/17316#issuecomment-3798278219
2026-01-26 10:50:50 +01:00
Guido Cella 70d3dc58e8 context_menu.lua: activate key hints with caps lock
Fixes https://github.com/mpv-player/mpv/pull/17316#issuecomment-3797615909
2026-01-26 10:32:05 +01:00
Guido Cella 7bfa2cfd3d input.conf: add context menu bindings
Rebind MENU to show the context menu. Shift+F10 is also bound because it
is a standard context menu binding.

MENU is not added to restore-old-bindings.conf because it is uncommon.
2026-01-25 20:56:42 +01:00
Guido Cella f4b37b6455 select.lua: populate the context menu
Make select.lua parse menu.conf on the first vo-configured and fill
menu-data with the properties referenced in menu.conf change. This is
disabled in the libmpv profile.

This is done from select.lua to reuse functions to format the data and
retrieve key bindings.

There is also a script-binding that opens the correct context menu
depending on --load-context-menu.

While the context menu is scrollable, for the playlist it is better to
start from around the current entry rather than from the beginning, and
since menu-data has no way to specify where to start, when there are
more than 25 items playlist items this adds … entries that open the
scrollable console menu when clicked.

input-bindings is parsed to show the shortcuts bound to commands. Since
it is not observable, it just uses the bindings from the first time the
context menu is opened.

Multimedia and numpad keys are also not shown to reduce clutter.

The old Context Menu section of the docs is merged in the more detailed
context_menu.rst to not repeat the same information.
2026-01-25 20:56:42 +01:00
Guido Cella 8f2d69e1cc select.lua: skip key bindings of forced input sections
Avoid showing forced key bindings by modal scripts that temporarily
overwrite keybindings, like console and stats. These have section
input_forced_$scriptName. Unfortunately this skips all keybindings added
with mp.add_forced_key_binding even if you may want to show them.

Also skip the OSC sections "input" and "window-controls"; these sections
are not called input_forced_osc because the OSC uses
mp.enable_key_bindings() directly instead of mp.add_key_binding().

This mainly benefits the shortcuts in the context menu that the next
commit will add, but is also useful select/select-binding.
2026-01-25 20:56:42 +01:00
Guido Cella df7ac1d931 command: add the default-menu property
This property contains the builtin etc/menu.conf, and will be used by
select.lua. It is undocumented because it is for internal usage.
2026-01-25 20:56:42 +01:00
Guido Cella 19adc2d509 menu.conf: add this file
Add a default context menu definition in etc/menu.conf. It will be used
to populate the context menu.

The format is meant to be easily readable with just tabs as separators
and submenus denoted by indentation. It avoids complicating the builtin
input.conf like similar scripts do.

By not defining the shortcut keys in the builtin input.conf, menu
entries won't be associated to wrong shortcuts when the user's
input.conf changes key bindings without redefining the menu. Note that
external scripts don't have this issue.

I used 3+ spaces as separators at first but then realized that since we
have Windows users tabs will look better in editors with proportional
fonts like notepad, though it still won't be perfectly aligned depending
on the font. But I am still not sure what is better.

On a curious note, etc/menu.conf already existed in the past as mplayer
used to have a menu. git log -p etc/menu.conf will show commits from
2002 to 2011.
2026-01-25 20:56:42 +01:00
Guido Cella 7e38052138 input.conf: format some commands more consistently
The formatting of input.conf commands is totally inconsistent. At least
for the commands that will be used in the context menu, make it
consistent. The next commit will define the context menu commands, and
the keys bound to these commands will be shown in the menu only when
they match exactly, so this avoids copy pasting commands with
inconsistent formatting just to make them match.
2026-01-25 20:56:42 +01:00
Guido Cella e99a9168c1 context_menu.lua: implement key hints
When a character in an item's title is preceded by &, underline it and
activate the item when pressing the character.

Cycling between multiple items with the same hint is not supported.

&& escapes & so it works like the Windows context menu.

Hints after &&&, or greater odd numbers of &, are not supported since
Lua patterns don't support {n,m} quantifiers.
2026-01-25 05:21:49 +01:00
Guido Cella dd50a4748e DOCS/man/commands: update an example
Use the new script name instead of relying on the backwards
compatibility script message.
2026-01-23 12:21:11 +01:00
Guido CellaandCogentRedTester cc1e654286 DOCS/man/lua: suggest keep_open for nested mp.input calls
Before 17551b2d43 keep_open was needed to make nested mp.input calls.
Even after that change it is still better to pass it to not show the
console quickly closing and reopening to the user, so recommend it.

Co-authored-by: CogentRedTester <cogent.redtester@outlook.com>
2026-01-23 10:15:04 +01:00
Guido Cella 7858e1fdaf command: remember the language when reloading tracks
In 5871ba8f3e I took the language from the filename when reloading
tracks noting "that backing up t->lang and restoring it if nt->lang is
NULL would work incorrectly when lang is in the stream and it is removed
before reloading", but actually external tracks don't have language in
the stream, it is set in the container, and reload commands only affect
external tracks. So just back up the language before reloading and then
restore the old language.

This preserves the language after reloading when it is not in the
filename but it was specified manually in an add command, e.g. sub-add
foo.srt '' '' en.

Hearing impaired, forced and default flags were already being set from
their values from before reloading the track, so setting them again from
the filename only caused the same issue that they would get unset if
they were manually added with add commands.

We still don't restore the old language if nt->lang is already set for
the edge case of doing something like sub-add foo.mkv and changing the
foo.mkv's sub track language before reloading.
2026-01-22 00:10:02 +01:00
Guido Cella 2c893e8f30 command: set the language of added tracks from the filename
If you do sub-add foo.en.srt, it doesn't set lang=en.

Fix this by extracting the language from the filename, along with
hearing impaired, forced and default flags.

If a language is explicitly passed to sub-add and related commands, that
takes priority.
2026-01-22 00:10:02 +01:00
Guido Cella 1da08fa332 DOCS/man/options: document that --script is not limited to Lua 2026-01-22 00:08:53 +01:00
Guido Cella 833e2f254e select.lua: link to mpv's IRC channel in the menu
Add a menu entry that opens mpv's IRC channel so users can quickly ask
support questions.
2026-01-21 11:27:07 +01:00
Guido Cella bbcd68f8ed demux_playlist: expand tilde placeholders in playlist files
This allows playing something like an m3u containing ~/foo.mp4 or
~~/foo.mp4.

URLs like memory://#EXTM3U\n~/foo.mp4 also work.
2026-01-12 15:10:37 +00:00
Guido Cella 8bbcdec992 Revert "{osc,select}.lua: show playlist entries with trailing /"
This reverts commit ee05804bfa. Only the
select.lua part since osc.lua list formatting was removed.

Since playlist/N/filename is now normalized, it is never going to have
trailing slashes so there is no need to strip them.
2026-01-12 15:10:37 +00:00
Guido Cella fc86b96a8a various: don't normalize playlist filenames again
Since the previous commit normalized playlist filenames when they are
stored, the code normalizing them can be simplified back to how it was
before implementing normalization.
2026-01-12 15:10:37 +00:00
Guido Cella dfb4164097 common/playlist: store normalized playlist filenames
This normalizes the playlist/N/filename sub-property, making it
consistent with path. As a consequence playlist-path and stream-path are
also normalized.

This will allow simplifying the code by not normalizing playlist
filenames in several places, similar to 23b57e9f7f for tracks.
2026-01-12 15:10:37 +00:00