1232 Commits

Author SHA1 Message Date
Kacper Michajłow 989d32716e options/options: add DSD audio extensions
dsf (DSD Stream File) and dff (DSDIFF).
2026-09-07 02:47:46 +02:00
Kacper Michajłow a2448f3b81 stream_dvda: expose DVD-Audio still images as a cover-art video track
DVD-Audio discs carry an Audio Still Video Set (ASVS). An MPEG-2 still
images (cover art, booklet/lyric pages) that the disc associates with
tracks.

A new STREAM_CTRL_GET_STILL returns the still for a given playback time.
demux_disc exposes it as a selectable mpeg2video track and injects the
still as a keyframe at the track's playback time. It changes as playback
crosses track boundaries (and follows onset times when a disc encodes
them).

--dvda-page (with the new STREAM_CTRL_SET_STILL_PAGE) forces a specific
still page instead of the scheduled one. The still state is guarded by
a mutex, runtime page changes arrive from the player thread while the
demuxer thread extracts stills.
2026-08-26 01:47:41 +02:00
Kacper Michajłow be04215d3f stream_dvda: add DVD-Audio playback support
Add a dvda:// protocol backed by libdvdread. Audio title sets are
enumerated from the ATS IFOs. Each ATS title is exposed as an mpv
title/edition and its tracks as chapters.

Menus are not supported, they would need full VM implementation, and
libdvdnav currently doesn't support DVD-Audio.

Still images (ASVS) may be supported in the future.
2026-08-26 01:47:41 +02:00
Kacper Michajłow fbd0e047b1 options: add disc-menu option 2026-08-26 01:47:41 +02:00
nanahi 731229bd2b options: add --playlist-inherit-options option
This allows controlling whether the files in a playlist inherit the
per-file options of the playlist file itself. For playlists created
by --autocreate-playlist, --playlist-inherit-options=current allows
inheriting only for the item the playlist is created from.
2026-07-26 11:49:16 +02:00
Kacper Michajłow 7ff087a6b0 options/m_property: avoid repacking list nodes if we can just steal it
Removes one redundant deep-copy. For example this makes playlist with
300_000 elements conversion to node from 800 ms to 470 ms. Not a big
improvement, but still it's free to do.
2026-07-23 12:16:59 +02:00
idontwannagoo 8ab3f8b66d options: add secondary-sub-scale
This allows scaling secondary subtitles independently from primary subtitles. The option defaults to 1 like --sub-scale and follows the other secondary-sub-* options by not inheriting from the primary subtitle setting.

Fixes #14989.
2026-07-22 19:32:01 +00:00
Mohammad AlSaleh 7aa8580cab options: store audio/sub delay in doubles instead of floats
An `--audio-file` could be sourced from a stream. A stream could be
 using timestamps that match unix time in their segments. In that
 case, setting `audio-delay` will lead to a big unexpected A/V desync
 due to the limited precision of floats.

 This commit changes `--audio-delay` (and --sub-delay while at it) to be
 stored in `double` instead of `float`.

 `audio_delay` was already up-casted to `double` wherever it was
 evaluated. Same for `sub-delay`, except its own value was getting
 adjusted based on `double` values in one place (bad!):

 player/command.c:6297

    mpctx->opts->subs_shared->sub_delay[track_ind] -= a[0] - refpts;

 A showcase:

    mkfifo /tmp/mpv
    date=$(date +'%s')

 Before:

    mpv --input-ipc-server=/tmp/mpv -
    echo 'print-text '"${date}" | socat - /tmp/mpv # 1782890841
    echo 'set audio-delay '"${date}" | socat - /tmp/mpv
    echo 'set sub-delay '"${date}" | socat - /tmp/mpv
    echo 'print-text ${=audio-delay}' | socat - /tmp/mpv # 1782890880.000000
    echo 'print-text ${=sub-delay}' | socat - /tmp/mpv # 1782890880.000000

 After:

    mpv --input-ipc-server=/tmp/mpv -
    echo 'print-text '"${date}" | socat - /tmp/mpv # 1782890841
    echo 'set audio-delay '"${date}" | socat - /tmp/mpv
    echo 'set sub-delay '"${date}" | socat - /tmp/mpv
    echo 'print-text ${=audio-delay}' | socat - /tmp/mpv # 1782890841.000000
    echo 'print-text ${=sub-delay}' | socat - /tmp/mpv # 1782890841.000000

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2026-07-02 17:38:51 +00:00
Kacper Michajłow c6833a9307 stream_curl: add libcurl-based stream backend
Introduces stream_http, an internal libcurl-driven backend for http://
and https:// URLs. Runs all transfers on a dedicated curl multi thread
with a producer-side ring buffer, and exposes HTTP/2 multiplexing,
QUIC/HTTP/3 (when libcurl supports it), HSTS and TCP keep-alive.

Should generally be more stable and faster than FFmpeg HTTP/1.1 impl,
additionally connections are kept-alive between files open, so if you
open playlist of network files and navigate through them, it will re-use
the same connection.

Build is gated on the new 'libcurl' meson option (auto). When disabled
or unavailable, mpv silently falls back to FFmpeg's HTTP implementation.
2026-05-16 18:20:42 +02:00
Kacper Michajłow cdd3f1197f stream: split shared network options into their own sub-options
Will be useful for future commits
2026-05-16 18:20:42 +02:00
Kacper Michajłow 96ade17428 options: fix stream_lavf options struct name 2026-05-16 18:20:42 +02:00
nanahi 21351a0580 options/m_property: only get m_option info when needed
Micro optimization.
2026-05-12 21:39:34 +02:00
nanahi f98b114d58 options/m_property: use mp_require for log
log cannot be null on write path which is true for multiply and switch.
2026-05-12 21:39:34 +02:00
nanahi ae23198144 options/m_property: simplify m_property_multiply/m_property_switch
M_PROPERTY_GET_CONSTRICTED_TYPE is already acquired, just pass m_option
directly.
2026-05-12 21:39:34 +02:00
nanahi 6320792f1b options/m_property: try to get constricted type in m_property_do
When setting properties via M_PROPERTY_SET_NODE, the property value
is limited by static declared range. However, some properties like
volume handle dynamic M_PROPERTY_GET_CONSTRICTED_TYPE requests and
return runtime determined limits. M_PROPERTY_SET_NODE in this case
does not respect that limit, and allows setting to a value out of
range.

Fix this by always trying to use M_PROPERTY_GET_CONSTRICTED_TYPE
first so that the dynamic limits will be used.
2026-05-12 21:39:34 +02:00
nanahi 27ec68fbd8 options/m_property: add log null check to m_property_multiply
Similar to m_property_switch, cannot be null for write paths.
2026-05-12 21:39:34 +02:00
nanahi 13550bd31d options/m_property: extract m_property_switch to a function
Similar to m_property_multiply.
2026-05-12 21:39:34 +02:00
nanahi 0ec3015339 player/external_files: remove handling related to update sub exts
This is only used to update the list for player internal sub ext matching.
Since this handling now lives in the dnd client, it can be removed from
core, which also eliminates a global variable.
2026-05-01 13:42:57 +02:00
nanahi 81611b4a4e input/dnd: move built-in drag and drop handling to mpv client
This moves the drag and drop handling to an internal mpv client,
removing the hardcoded handling from core.
2026-05-01 13:42:57 +02:00
nanahi 777401d7de options/m_property: add SUB_PROP_STRING_LIST
Helper used in next commits.
2026-05-01 13:42:57 +02:00
Kacper Michajłow 28ce461a84 options/m_option: add m_option_type_prop_array
Add adaptor for arrays of properties, this is not used as real option,
as those are always string list. But as a connector struct for creating
typed node arrays, in (sub)_properties.
2026-05-01 11:41:31 +02:00
Kacper Michajłow eedadc24ae player/command: hide dependent tracks
They are unusable on thier own, and shouldn't be selected by the user.
Those tracks are ment to be used internally.
2026-05-01 10:42:00 +02:00
Kacper Michajłow b4a7ea306e demux_{lavf,timeline}: add --flatten-editions
Lavf exposes programs/renditions as a flat track list tagged with
program_id. We respect this metadata and group tracks into their
respective programs, as tracks from different programs may be completely
unrelated to each other.

This commits adds an option to flatten the editions and ignore the
grouping.

Fixes: https://github.com/mpv-player/mpv/issues/17836#issuecomment-4345930205
2026-05-01 10:42:00 +02:00
Julian Orth 4c9262664c wayland: implement session management
If the compositor supports session management, the mpv window is always
added to a session. The user can manage multiple sessions by using
`--wayland-session=<human-readable-name>`. Human-readable names are
mapped to session ids via files under `~/.local/state/mpv/sessions`. The
file name is computed as a hash of XDG_CURRENT_DESKTOP and the
human-readable name.

If multiple mpv instances are started with the same session name, the
latter mpv instance takes over the session.

Upon session restoration, the mpv window is restored by the compositor
according to its state from the previous session. What that entails is
compositor policy.
2026-04-24 15:36:44 +00:00
alydev d40a29190d demux_playlist: add support for 'strm' playlist
The .strm format consists of a URI or local path as the sole contents
of a text file, this is parsed by software like Emby or Jellyfin to
treat remote streams or paths as if they are in the local filesystem.
This commit adds .strm to mpv's internal list of playlist file formats,
and points it to the handler for .m3u files as they should be
compatible. .strm doesn't need all the features of .m3u/.m3u8, but the
features do not cause issues with the relatively barebones playlist
format of .strm.
2026-04-22 03:23:50 +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
nanahi d711657833 options/m_option: use bstr_find_in_list0
Removes redundant find_list_bstr function.
2026-04-17 04:09:23 +02:00
nanahi da2739f44f various: don't check if endptr is null for strto[udll]
These functions always set endptr to non-null so there is no need to
check.
2026-04-17 04:09:23 +02:00
NRK 9251f871b6 options: preparse --shuffle
needed in order to correctly handle --directory-mode=auto

Fixes: https://github.com/mpv-player/mpv/issues/17601
2026-04-06 18:27:27 +02:00
nanahi 9bf9bb50de options/m_option: fix valid format in geometry option help message
/WS format is accepted.
2026-04-06 18:23:25 +02:00
nanahi 94d06bc727 options/m_option: allow /WS geometry parameter usable without XYWH
This allows specifying workspace while using autofit for window size
or leave it as default instead of mandatory geometry in pixels.
2026-04-06 18:23:25 +02:00
llyyr de118fdb70 m_option: don't allow m_geometry_apply to make a coordinate 0
Same reasoning as the previous commit.
2026-03-30 00:53:18 +00:00
Rudi Heitbaum 8ace278cbe various: fix Wdiscarded-qualifiers warnings
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
2026-03-15 14:49:00 +01:00
Kacper Michajłow e54cee1b23 player/command: apply expand-properties modifier also for string lists 2026-02-27 20:18:42 +01:00
llyyr e09a1d12f2 m_option: also clamp OPT_FLOAT values for float_set
This incorrectly used clamp_double function after 0e7f9c39dc when it
should've always used clamp_float instead. Use clamp_float instead

Fixes: 0e7f9c39dc ("m_option: correctly clamp OPT_FLOAT values")
2026-02-24 19:41:53 +01:00
Kacper Michajłow ae119448b2 m_option: remove duplicated code for float/double range check
The float version was missing "default" case. This fixes options with
M_OPT_DEFAULT_NAN.

Fixes: 0e7f9c3
Fixes: #17436
2026-02-24 19:41:53 +01:00
zenodity f439c7f62c m_option: fix x:y mode format when printing geometry
Previously, x:y mode geometry strings were incorrectly printed
using the WxH+x+y format.
2026-02-22 22:31:40 +01:00
nanahi d6e7fb0597 options/options: add several audio extentions
mp1 - MPEG-1 Audio Layer I
mp2 - MPEG-1 Audio Layer II
mpc - Musepack
tak - Tom's lossless Audio Kompressor
tta - The True Audio
2026-01-20 07:49:17 +01:00
Hubert Głuchowski 2b78ac44a9 demux/demux_sbr: allow configuring probe size 2025-12-23 07:01:29 +01:00
Hubert Głuchowski bb97882c9a sub: add subrandr renderer support
subrandr is a subtitle rendering library which aims to render
SRV3 (YouTube) subtitles and WebVTT subtitles accurately.

Currently in mpv WebVTT subs are rendered via ffmpeg conversion to ASS
which throws away a lot of the style and completely disregards
the WebVTT non-region-cue positioning algorithm. Furthermore if
one wants to render some more complex SRV3 subtitles one has to
resort to external converters since it's not even supported by ffmpeg.

However subrandr is able to render SRV3 subtitles natively with support
for the most commonly used features. It can render ruby text without
relying on font metrics during conversion which is obviously fragile,
and it can perform correct scaling using the exact calculations used by
YouTube instead of making up ASS approximations. Similarly it follows
the WebVTT spec for the features of WebVTT that it supports (mostly).

It's not perfect of course and there's still many things it doesn't do
or does wrong but those are things that can be incrementally improved
outside of mpv.
2025-12-23 07:01:29 +01:00
Guido Cella acd3378c9b Revert "ytdl_hook: add option to extract chapters"
This reverts commit df1e71a7cc.

The next commit will make this unused since chapters will only be taken
from yt-dlp's JSON.
2025-12-19 18:06:14 +01:00
Kacper Michajłow 9a85ae3ee0 m_option: be more resilent to new enum additions
Unfortunately we don't have control over libplacebo and cannot
synchronize such changes, so just return `<unknown>` to be forward
compatible with any possible changed.

Note that this should be updated ASAP to support new values.
2025-11-28 18:28:06 +01:00
Kacper Michajłow 10c9b3381b options: add mxf to video file extensions list 2025-10-15 22:00:08 +02:00
llyyr be5e606377 sub: make --sub-fix-timing configurable
Instead of hardcoding the threshold and keep duration in a header,
expose them as options for users to configure and set old hardcoded
values as the new defaults for those options.
2025-10-05 21:35:20 +02:00
Kacper Michajłow b4c2471174 options: reduce swapchain-depth to 2 by default
It's enough to not wait for the flip and start with next frame and in
the same time minimized latency which helps display-sync modes, that are
not aware about swapchain depth.
2025-09-27 22:15:13 +02:00
ikas 0bbcc91e1b video/out/d3d11: add changing size support for composition mode 2025-09-19 02:26:08 +02:00
Guido Cella 8406834075 context_menu.lua: add this script
This implements a ASS context menu to be used on platforms other than
Windows.

The select script message will allow selecting an item with a single
click when releasing a mouse button, like in native context menus. This
is mainly useful to cycle pause with one click.
2025-09-15 04:12:57 +02:00
arch1t3cht eba7a11a2e player/command: do seamless angle change when bluray-angle is changed 2025-09-15 03:52:35 +02:00
arch1t3cht e6e7083ce6 options: remove leftover bluray_device field
This was moved to stream_bluray_opts in
8a7704ea89.
2025-09-15 03:52:35 +02:00
Kacper Michajłow 4f08802ff1 osdep/w32_register: add register/unregister options for Windows
On Linux, we have `mpv.desktop`, and on macOS, we have `osxbundle`, both
of which handle file associations and protocol registration in the
system environment.

On Windows, this information is stored in the registry, so this commit
adds support for it.

It registers the application, supported file types, and supported
protocols, and adds an uninstall entry so users can remove all
registrations via the control panel. Note that this does not remove the
binary itself.

The implementation is fully portable. There are no external installers,
as mpv handles everything automatically. This should improve usability
when moving binaries and so on.

- `mpv --register` registers mpv (see verbose output for a list of actions).
- `mpv --unregister` reverts all changes made during installation.
- `mpv --register-rpath <string>` allows specifying a string to be
  prepended to `PATH` before running mpv. This is useful when using
external dependencies that shouldn't be added globally to `PATH`.
2025-09-15 03:47:35 +02:00