Commit Graph

52570 Commits

Author SHA1 Message Date
Guido Cella fe760f2b8a console.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Dudemanguy df166c1333 mpv.desktop: fix capitalization error
Missed in 481e498427
2024-06-01 15:08:59 -05:00
x9a 481e498427 mpv.desktop: add Arabic translation
Added Arabic translation for "Name", "GenericName", "Comment", and
"Keywords" entries in the .desktop file.
2024-05-30 12:54:44 +00:00
llyyr c2968244e4 TOOLS/gen-interface-changes: wrap long lines to 80 col 2024-05-29 17:48:50 +00:00
llyyr 7aaa7b221f input.conf: change 'u' binding to cycle between 'force' and default 2024-05-29 17:48:50 +00:00
llyyr de8bce33ed options: make sub-ass-override default to 'scale'
Previous commit changed the semantics of 'yes', so change the default to
scale to prevent unexpected user facing changes
2024-05-29 17:48:50 +00:00
llyyr f37691a156 options: move sub-ass-override 'scale' above 'force'
Also make it an enum for clarity

This is the right order in terms of both destructiveness and also the
total number of --sub-* options applied.
2024-05-29 17:48:50 +00:00
llyyr af7ab6f603 sd_ass: only set sub-scale for 'scale', 'force' or 'strip'
Currently we also set it for sub-ass-override=yes which is unintended
2024-05-29 17:48:50 +00:00
Dudemanguy 42181a8769 DOCS/input: clarify the difference between audio-pts and time-pos
In light of the changes in the recent commits.
2024-05-29 13:48:40 +00:00
Dudemanguy 5988473b76 player: replace get_current_time with get_playback_time in some spots
The problem with using get_current_time is that it can return negative
values. Interally in mpv, we need this but for some spots negative
values are not great. Since the previous commit enforced nonnegative
returns for get_playback_time, we can use that instead. The two areas
changed here are watch later configfile writing (clearly should always
be a positive number) and the time-pos property (negative numbers are
nonsense for users). This fully fixes #10346.
2024-05-29 13:48:40 +00:00
Dudemanguy d93f53b324 player/playloop: force get_playback_time to be at least 0
Except for MP_NOPTS_VALUE. We keep that as is. When this was originally
added in a73415584c, it appears like
having the time always start at 0 was the intent. In cases where
get_current_time returns a negative that isn't MP_NOPTS_VALUE, force
this to 0.
2024-05-29 13:48:40 +00:00
Dudemanguy 652036ba54 player: put speed adjustment back into playing_audio_pts
Effectively reverts 7051e94e4b. There's
been some confusion with how audio pts gets used internally in mpv which
leads to weird results. The crux of the problem is essentially that
playing_audio_pts can return negative numbers and in many places this is
not expected. This is the first step in trying to hopefully iron out all
the weird corner cases.
2024-05-29 13:48:40 +00:00
nanahi eaae9e9cf5 player/video: fix incorrect VO frame duration and frame drops
The logic in question was added in 201bef7ee1
for the VDPAU vsync frame timing algorithm, but after the code was moved
around for several times, it is now used for all VOs with non-display-sync
mode (where the video is synced to audio or system time). It nonetheless
likely never did whatever it was intended for.

This "correction" reduced the VO frame duration by the amount that the
frame is fallen behind the ideal time. Since a frame is presented between
pts (the ideal time for which the frame is scheduled) and pts + duration
(the end time for which frame drop is determined), and pts is already
computed from the current time and the deviation from the ideal time, this
"correction" causes the end time to have the deviation added twice, which
is nonsense: if the deviation is -0.5x the frame duration, the frame is
dropped, even though it should be displayed from now to 0.5x the frame
duration from now.

It was not noticed at that time probably because the VDPAU secret rabbit
code undid some of its damage, and the subsequent development focus on
display-sync modes resulted in negligence and simplification of audio mode
(e.g. b8bcf0f466), but the generic VO frame
drop algorithm has been observed to cause inconsistent frame drops with
this "correction": playing a 59.94 Hz video at 2x speed on a 60 Hz display
results in spending over half of the time dropping adjacent frames instead
of every other frames, visually causing stuttering, while it should only
happen briefly when the pts is very close to vsync time.

Fix this by deleting this logic, making the VO frame always having the
duration of the video frame.

Fixes: 201bef7ee1
2024-05-29 13:39:32 +00:00
Dudemanguy 52bdeb07a1 x11: correct position coordinates if mpv was launched with --fs
If mpv is launched with --fs, the x11 code tries to reset the size and
position of the window when the fullscreen exits. This has bad behavior
with multiple monitors because the saved nofsrc is not reliable in many
situations. Particularly if the window manager moves the fullscreen
window somewhere else while mpv is fullscreen. The result will be that
exiting fullscreen always goes back to screen 0.

Fix this by translating the rc coordinates of the nofsrc rc to the new
monitor when we're leaving fullscreen from an initial --fs case. By
giving get_current_display a specific rc, we can return what xrandr
display the coordinates are associated with and decide if the nofsrc
should be translated to its new location. After that bit of math, the
usual move/resize logic takes care of the rest but this time it actually
works off of the correct position. Fixes #14226.
2024-05-29 13:39:20 +00:00
llyyr 7ff6cf807c vo_vaapi: remove redundant function call
we already free video specifics when reconfiguring
2024-05-28 21:29:07 +02:00
llyyr 0aec73d1bf vo_vaapi: fix use-after-free when quitting
p->output_surfaces gets freed by destroy_frame when quitting
2024-05-28 21:29:07 +02:00
llyyr ff73aeb5c3 vo_vaapi: fix use-after-free of current frame
This was forgotten when switching vo_vaapi from using draw_image to
draw_frame API

Fixes: 0b70598358 ("vo: fully replace draw_image with draw_frame")
2024-05-28 21:29:07 +02:00
Guido Cella 15ea0d1987 console.lua: fix crash with set ;<Tab>
Fixes https://github.com/mpv-player/mpv/pull/14247#issuecomment-2134418206
2024-05-28 13:25:37 +00:00
nanahi 75f252c47c console.lua: fix crash if no completions exist
If complete is case-sensitive and no completions exist the script crashes
with the following:

Lua error: @console.lua:1417: attempt to concatenate local 'prefix'
(a nil value)
2024-05-28 13:24:16 +00:00
Misaki Kasumi ef026ffdb6 Revert "ao_pipewire: add EOF handling"
This reverts commit 3fc8929caf.
2024-05-28 13:23:17 +00:00
Misaki Kasumi 2938ed5942 Revert "ao_pipewire: wait for draining finishes before restart ao"
This reverts commit 88f20a7011.
2024-05-28 13:23:17 +00:00
Guido Cella 021c5dedb1 playloop: don't loop when seeking to the end of cover art while paused
Fix the bug that seeking to the end of cover art while paused goes back
to the beginning of the file because of this condition meant for videos.

This doesn't check mpctx->vo_chain->is_sparse because prevent_eof should
be true with actual sparse videos.
2024-05-26 14:23:57 +00:00
Misaki Kasumi 88f20a7011 ao_pipewire: wait for draining finishes before restart ao
When the stream is draining, setting stream to active has no effect.
2024-05-25 22:52:45 +02:00
Misaki Kasumi 3fc8929caf ao_pipewire: add EOF handling 2024-05-25 22:52:45 +02:00
Misaki Kasumi a3a9bc289a ao_avfoundation: use blocking ao_read_data 2024-05-25 22:52:45 +02:00
Misaki Kasumi eb996a13bc ao_avfoundation: add EOF handling 2024-05-25 22:52:45 +02:00
Misaki Kasumi aebe58203b ao: add ao_stop_streaming 2024-05-25 22:52:45 +02:00
Misaki Kasumi bfadd31957 ao: add eof, pad_silence, and blocking arguments for ao_read_data 2024-05-25 22:52:45 +02:00
Misaki Kasumi a791408659 ao_coreaudio: set ao->device_buffer base on hardware latency 2024-05-25 15:35:26 +02:00
maxdunbar 4e6d591f12 osxbundle: refactor Information Property List
Includes cleanup of CFBundleDocumentTypes, UTImportedTypeDeclarations,
LSItemContentTypes. Reordered general structure of the Property List as
in nodes/collections/arrays. Declared MIME types.
2024-05-25 15:28:52 +02:00
nanahi 2fa66b850d wayland_common: ignore unknown key states
Once https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/368
is merged and we upgrade wl_seat version to 10, compositors will also
generate "repeated" events, which mpv treats as key up right now.
Change the check so that unknown key states are ignored.
2024-05-24 17:57:55 +00:00
nanahi 0fcfbab9af wayland_common: handle pressed keys in keyboard_enter event
This is required by the wayland protocol to keep the logical keyboard
state consistent.
Quoting 9e4f256927:

> In the wl_keyboard logical state, this event sets the active surface to
> the surface argument and the keys currently logically down to the keys
> in the keys argument.
2024-05-24 17:57:55 +00:00
nanahi 43136b603a DOCS/man: replace legacy option syntax usage
They are replaced by --option=value.
2024-05-24 17:57:43 +00:00
Kacper Michajłow f652f38147 Revert "fuzzers/load: clear old temp files if they exist"
It is not a problem, so revert.

This reverts commit 06ec0319db.
2024-05-24 16:55:04 +02:00
Kacper Michajłow 7923a633a0 ad_spdif: check return value of av_parser_parse2 2024-05-22 22:13:54 +02:00
Kacper Michajłow 82ce07d640 ad_spdif: check for AC3 if parser fails to detect profile
c522d0dfbd added parser to avoid opening
decoder and left decoder only for DTS. Since then more audio codec needs
decoder, so open decoder always when it might be needed. Exclude only
AC3, other codec have profile to be extracted.

Fixes: c522d0dfbd
2024-05-22 22:13:54 +02:00
Kacper Michajłow 6eb0f4b27f ad_spdif: set codec params
It seems that we decode small portion of the audio to determine codec
params. We can remember that information.

Fixes: #14178
2024-05-22 22:13:54 +02:00
Dudemanguy 7b77672794 stream_lavf: don't add ffmpeg bluray or dvd protocols
The naming of these conflict with existing mpv protocols, so skip if we
get them. Users can still use them via lavf://bluray: or lavf://dvd: if
they wish.
2024-05-22 20:10:52 +00:00
Dudemanguy 056b03f9ed build: dynamically generate mpv.desktop file protocols
If we can run the built mpv binary, then it is possible to use a custom
target that reads the protocols we have available in mpv and write the
mpv.desktop file based on the output. For cases where this is not
possible (e.g. cross compiling), then just install the unmodified
mpv.desktop file like before. Fixes #8731 and fixes #14124.
2024-05-22 20:10:52 +00:00
Dudemanguy f921b64ed7 stream: implement get_protocols method for stream_lavf
Previously, all stream protocols were a static list in mpv. This is okay
for own builtin stuff, but for protocols that depend on ffmpeg it's not
so great. Support for certain protocols may or may not be enabled in a
user's ffmpeg and the protocol list that mpv generates should ideally
match this. Fix this by implementing a get_protocols method for
stream_lavf that will have different results depending on the ffmpeg mpv
is built against. We keep the safe and unsafe protocols separation. The
former is essentially a whitelist. Any protocol that is found in ffmpeg
but is not in the safe whitelist is considered unsafe. In the stream
list, ffmpeg is moved to the bottom so any possible protocols that are
added in the future don't automatically take precedence over any builtin
mpv ones.
2024-05-22 20:10:52 +00:00
Dudemanguy 406301f23d av_common: parent mp_get_lavf_demuxer contents to the list
The only usage of this function is freed in mpv's generic property code,
so no other changes are needed.
2024-05-22 20:10:52 +00:00
Dudemanguy 1e1e365c18 wayland: use wl->callback_surface for idle inhibitor creation
The idle inhibit protocol specifies that the compositor may ignore the
idle inhibitor if the surface is occluded. In the case of
vo_dmabuf_wayland, wl->surface corresponds to typical black bars when
the video aspect ratio is different than the display's. So in many
cases, wl->surface is actually occluded by wl->video_surface which sits
above it. Change this so that the idle inhibitor is created on
wl->callback_surface instead which is either wl->surface for the gpu VOs
or wl->video_surface for vo_dmabuf_wayland. Fixes #14206.
2024-05-22 14:08:01 +00:00
Kacper Michajłow 06ec0319db fuzzers/load: clear old temp files if they exist
They were previously left over, and now that it looks like runners are
stuck, the big question is: is /tmp persistent?

This commit will be reverted after the next rebuild.
2024-05-22 02:09:47 +02:00
qadzek 0dd6321c51 DOCS/man/console.rst: remove extraneous words 2024-05-21 16:02:03 +02:00
Kacper Michajłow 072d0ac836 mp_image: remove unneeded PL_HAVE_LIBDOVI check
This function is always available, if libplacebo is compiled without
libdovi it is no-op.
2024-05-21 11:23:29 +02:00
Kacper Michajłow e56054bc40 fuzzers: always return 0
While LibFuzzer supports rejecting unwanted inputs, it looks like
Honggfuzz treats anything other than 0 as fatal error.

https://llvm.org/docs/LibFuzzer.html#rejecting-unwanted-inputs
348a472139/libhfuzz/persistent.c (L67)
This LOG_F calls exit(EXIT_FAILURE)
2024-05-21 06:28:18 +02:00
Guido Cella 76ad8efe39 DOCS/options: --sub-scale-by-window doesn't affect ASS subtitles 2024-05-20 21:04:19 +02:00
Guido Cella 4bbaa4d0d0 ci/lint: only allow specific characters in subjects 2024-05-20 20:59:10 +02:00
Guido Cella 7c4e7d8c7b ci/lint: allow the first word after : to be an option with -- 2024-05-20 20:59:10 +02:00
Guido Cella 68a5490be2 ci/lint: only allow space instead of \s or \s+ 2024-05-20 20:59:10 +02:00