Commit Graph

53438 Commits

Author SHA1 Message Date
Guido Cella
61aa8200ad console.lua: complete clipboard/text 2024-12-28 14:09:07 +01:00
Guido Cella
a0f8d27aba input.conf: bind Ctrl+v to play the path in the clipboard 2024-12-28 14:08:32 +01:00
der richter
cd9fa6daf0 mac/title: remove old libmpv color setter fallback 2024-12-28 01:46:41 +01:00
der richter
51af3caa77 mac/title: remove old libmpv material setter fallback 2024-12-28 01:46:41 +01:00
der richter
11a9f355c7 mac/title: remove old libmpv appearance setter fallback 2024-12-28 01:46:41 +01:00
Kacper Michajłow
bafb054cfc ci/win32: enable tests for dependencies
We build and ship this code, so it makes sense to make sure it is ok.

Tests for FFmpeg, libass and libplacebo are explicitly enabled. The rest
is in default state, so if tests are enabled by default, they will run.
2024-12-27 14:01:36 +01:00
der richter
379c078869 meson: only build libmpv_helper with cocoa-cb 2024-12-26 15:00:57 +01:00
der richter
bba198a713 mac: use isBundle function instead of manually checking bundle usage 2024-12-26 15:00:57 +01:00
Kacper Michajłow
d9eb9ed844 video/sws_utils: remove unused mp_image_swscale
This has been used before 2c43d2b75a. Now
that we have also zimg support, using swscale directly may not be wanted
depending on the user options.
2024-12-25 18:01:56 +01:00
der richter
d389c06646 console.lua: use native clipboard property on macOS 2024-12-24 16:11:45 +01:00
der richter
026f1fb61d clipboard-mac: add macOS clipboard backend 2024-12-24 16:11:45 +01:00
der richter
e8ecc7d9d9 osdep/mac/meson.build: dynamically add features to swift build flags
similar to how our config.h is created the feature flags added to the
swift build should be generated from our features array, instead of
manually adding those when needed.

this prevents errors when forgetting to add any needed flags or remove
obsolete ones.
2024-12-24 16:10:52 +01:00
der richter
cf01fdddb5 DOCS/ao: add missing documentation for audiounit
was forgotten in initial implementation 8 years ago 3f5b41d.
2024-12-24 16:10:24 +01:00
der richter
d82701962f libmpv: deprecate MPV_RENDER_PARAM_AMBIENT_LIGHT render parameter
the equivalent options have been deprecated since mpv 0.35 in ac39661
and 2207236.

also bumping the MPV_CLIENT_API_VERSION to 2.5, since 2.4 was forgotten
in 6f619d5.
2024-12-21 16:15:44 +01:00
der richter
e785296a1c cocoa-cb: use new ambient-light property and remove old libmpv usage 2024-12-21 16:15:44 +01:00
der richter
e0f82b1a77 gamma-auto.lua: add this script as replacement for --gamma-auto
also mention this replacement for --gamma-auto.
2024-12-21 16:15:44 +01:00
der richter
2b06728df9 command: add ambient-light property
make it observable to make it usable as a replacement for --gamma-auto.
2024-12-21 16:15:44 +01:00
der richter
811062279e vo: change VOCTRL_GET_AMBIENT_LUX from int to double 2024-12-21 16:15:44 +01:00
der richter
568e2c357b DOCS/contribute.md: add guidelines for Swift and Objective-C 2024-12-21 16:13:08 +01:00
Dudemanguy
96bebf0935 x11: simplify --geometry and --auto-window-resize logic
There were a few pitfalls with the way this was previously implemented
because --geometry implicitly depended on --auto-window-resize being
enabled to operate in a few cases. Instead, let's change the logic a bit
so that instead we choose whether or not to reuse the old rc (i.e. don't
resize) and use the wh_valid and xy_valid fields within the m_geometry
struct instead of using x11->geometry_change. This fixes several edge
cases involving setting the position with --geometry when using
--auto-window-resize=no.
2024-12-20 18:03:30 +00:00
nanahi
8ee1aeaf1a DOCS/man: fix Unicode capitalization 2024-12-20 14:54:35 +00:00
nanahi
298c178f1e input.conf: use capital letters instead of shift modifiers
Follow the suggestion of keyname documentation.

Fixes: b4d9980870
2024-12-20 14:54:35 +00:00
nanahi
b174d98042 video/out/wayland_common: make all XF86 special keys mappable
Forgotten in 417869f845.
2024-12-20 14:54:35 +00:00
nanahi
1107bdb62e DOCS/man/input.rst: clarify hexadecimal key names
Document the syntax and mention how it can be used as Unicode
codepoints. ASCII range has worked since the feature was inplemented
in 86a87de590 and Unicode range has
worked since a63e880400.

It also works with known special keys if you know the internal values
of keys because there is no filtering in place, but this should not be
encouraged.
2024-12-20 14:54:35 +00:00
nanahi
269e402579 DOCS/man/input.rst: clarify that caps lock affects produced keycode
Because mpv keycodes are whatever the text the keyboard input produces,
caps lock also affects this.
2024-12-20 14:54:35 +00:00
nanahi
4711e40814 DOCS/man/input.rst: clarify shift modifier behavior
When shift modifier is used with text key names, it is usually
silently ignored, except for ASCII key names, which can be
confusing. Document it clearly.
2024-12-20 14:54:35 +00:00
nanahi
f8a5df56cc DOCS/man/input.rst: fix grammar 2024-12-20 14:54:35 +00:00
Guido Cella
38c46e4d89 stats.lua: enable runtime script-opt changes
This doesn't work for changing page key script-opts at runtime because
they are used as the indexes of the pages variable, but nothing actually
breaks if you do, it just uses the initial values. This is still useful
for conditionally changing sizes at runtime or for trying out the
osd-box profile by applying it from the console.
2024-12-20 14:54:20 +00:00
Guido Cella
19537a4996 console.lua: inherit --osd-color and --osd-outline-color
Stop overriding the OSD font and outline color in the console input line
and log, except for the lines already in a different color. This allows
configuring the console color and makes it consistent with the rest of
the OSD, like 51bd00c33a did for stats.
2024-12-20 14:54:08 +00:00
Kilian Evang
5354a50f9f DOCS: fix description of subtitle delay adjustment
Modified the man page.

There were two pairs of key bindings that appeared in one order but
the description of what they do appeared in the reverse order. Modified
the description to match the order in which the keys appear.

Note: I have not tested this change.
2024-12-20 14:53:26 +00:00
Guido Cella
661a380fda console.lua: color the default item with --osd-selected-color
Currently if you change --osd-selected-color the preselected item stays
yellow and can't be changed. Since the default item style was just
chosen from the selected color without the bold, also make the default
item follow --osd-selected-color.

Requested in
https://github.com/Samillion/ModernZ/issues/259#issuecomment-2556608926.
2024-12-20 12:43:34 +01:00
norinoriko
566c3ef367 DOCS/man/console.rst: remove outdated issue
This was fixed for win32.

See-Also: https://github.com/mpv-player/mpv/pull/15355
2024-12-20 12:34:32 +01:00
nanahi
1723f8a9d2 sd_ass: fix fix_margins calculation
Saving old playresx method is incorrect after the first
configure after the subtitle is loaded.

Fixes: f862d3b6cd
2024-12-19 19:43:27 +00:00
llyyr
32d103c580 meson: bump libdrm version to 2.4.109
The previous check was incorrect because drmGetDeviceFromDevId is only
available since 2.4.109.

57e0b0552e

Fixes: 0d7b4d64a5
2024-12-17 23:30:48 +00:00
Guido Cella
a6f93ac81e options: add heic and heif to --image-exts 2024-12-17 23:30:32 +00:00
yk
96fad6a0fc ytdl_hook: pass empty proxy value
an empty value to a commandline option usually means that parameter does
not expect anything, but in case of `--proxy`, yt-dlp use an empty value to
disable proxy setting, the empty value need to be passed to `--proxy`
2024-12-17 22:26:46 +02:00
Guido Cella
2756a780b2 demux_lavf: remove obsolete defines
AV_DISPOSITION_TIMED_THUMBNAILS was added in FFmpeg 3.2 and
AV_DISPOSITION_STILL_IMAGE in FFmpeg 4.1, and we require FFmpeg 6.1.
2024-12-17 20:05:20 +00:00
Guido Cella
7715e2e255 demux_lavf: detect heif/heic as images
Like 565e7d906c did for avif, consider 1-frame HEVC as images, as HEVC
videos have nb_frames 0 or > 1.

Specifically, in the FATE suite:

nb_frames = 0 and are images:
cbf_cr_cb_TUDepth_4_circle.h265 food.hevc hdr10_plus_h265_sample.hevc
hdr_vivid_h265_sample.hevc hevc-monochrome.hevc

nb_frames = 0 and are videos:
mv_nuh_layer_id.bit paired_fields.hevc
paramchange_yuv420p_yuv420p10.hevc pir.hevc

nb_frames > 0:
dv84.mov extradata-reload-multi-stsd.mov multiview.mov
two_first_slice.mp4

As with other video codecs, the hevc images with nb_frames = 0 which are
really frames cut from a video are not detected as images, but you will
only find these files in FATE.
2024-12-17 20:05:12 +00:00
Guido Cella
e52f975842 osc.lua: simplify track ID retrival
When track IDs are auto mp.get_property_native() returns "auto", but
mp.get_property_number() returns nil.

Follow up to 1a558bf5c2 and 897c04afe1.
2024-12-13 18:46:53 +01:00
Guido Cella
5e4b825a48 select.lua: abort edition selection when there's only 1
MKVs have 1 edition by default so don't show an empty edition selection
in that case.
2024-12-13 03:46:03 +01:00
Guido Cella
dbb3291e8e DOCS/man/osc: sort mouse bindings consistently
Always list in the order left shift+L middle right click.
2024-12-12 21:54:44 +01:00
Guido Cella
cac6b663c7 osc.lua: show the full path when right clicking the title
Right clicking playlist arrows already opens the playlist selector so
bind something else to right clicking the title. Make it show the full
path which is useful but not bound anywhere on either the keyboard or
the OSC.
2024-12-12 21:54:44 +01:00
Guido Cella
365a33badd osc.lua: open the playlist selector when right clicking playlist arrows
- It makes more sense to select a playlist entry from the buttons that
  navigate the playlist than from the title
- Provides different bindings for right and middle click
- Mirrors chapter button bindings
2024-12-12 21:54:44 +01:00
Guido Cella
f4a35a0264 osc.lua: move title mbtn script-opts below playlist_next's
Sort mbtn script-opts according to how they are shown to the user in bar
layout instead of how they are defined in osc_init().
2024-12-12 20:35:55 +01:00
Guido Cella
53554f521b DOCS/man/osc: update track middle-click action
Fixes 92a98f1ce2.
2024-12-12 17:48:53 +01:00
Kacper Michajłow
5897b66454 demux_mkv: limit EBML size to 64 MiB for fuzzing
OSS-Fuzz is limited to 2GiB of process memory, so allocating 512 MiB is
not working well and causing OOMs.
2024-12-12 01:45:19 +01:00
Kacper Michajłow
c14af4ebad options: disable playlist and include for fuzzing
Both of this options reads files, so there is not much to test there and
only creates problems with timeouts when too much is read.
2024-12-12 01:45:19 +01:00
Kacper Michajłow
9c81c67e2a m_property: stop processing after 10 properties even in skip cases
For OSS-Fuzz.

See: 2054d872d4
2024-12-12 01:45:19 +01:00
Dudemanguy
d33e54250e ao: correctly set state.playing for non-gapless audio after eof
The problem here is likely ao_alsa specific and has the same symptons as
what the previous commit fixed (audio not playing when the file changes
but the details are a bit different here and the sample rate does not
matter. When using gapless audio (the default), the core player
immediately marks the audio status as EOF after it starts draining and
allows the remaining audio buffers to play while it marches on. This
works fine. When not using gapless audio, it doesn't immediately set EOF
and instead waits for the audio to finish playing before it does
anything else. The problem is that ao_is_playing is always true so the
core waits forever thinking audio is still playing when it actually
isn't.

ao_play_data is what is in charge of setting the mp_pcm_state with it
calling out to the backend for additional help. Unfortunately, this
doesn't work for alsa because it's too dumb to signal the desired states
in this edge case so we have to help it a bit. The main thing to notice
here is that even though we can get EOF from a frame, there can still be
additional valid samples that compe after it. So we can't just
immediately quit after EOF is seen. The approach here is to simply save
if we got eof sometime in the past, wait until we get no more samples,
mark state.playing as false and then jump over to the eof code. This
will set p->playing to false as desired which allows the core code to
set EOF and finally we can go through the reset logic and actually play
audio for the next file.
2024-12-11 17:12:22 +00:00
Dudemanguy
a7f6460e7e player/audio: get rid of bogus early return in reinit_audio_filters
There is a condition here that is supposed to wait until the ao is
finished playing before it goes through the rest of this function and
actually starts the reinit of the audio chain. This is not needed
however and actually causes a bug. uninit_audio_out already takes the
gapless audio case into account and drains the audio before preceding.
There is no reason to bail here. Additionally, returning early here
actually breaks ao_alsa. ao_alsa is pretty dumb and not able to cope
with changing samplerates. It explictly needs to stop the PCM and then
start it again for it to work. The old code here ensured the ao would
never reinit itself and then would wait forever trying to play samples
with no actual data. Other AOs (pipewire and pulse) seem to be able to
cope with this and reinit themselves in other ways (didn't look in
detail). This change makes no difference for them. Note that in many
cases, this appeared to work on ALSA because there is a high likelihood
that your default audio device will choose a 48 kHz sampling rate and
thus your entire playlist is resampled to 48 kHz which avoids the
bug.

Fixes #15477.
2024-12-11 17:12:22 +00:00