1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-20 22:40:52 +00:00
Commit Graph

52491 Commits

Author SHA1 Message Date
Kacper Michajłow
8a9901963d test/libmpv_encode: don't use mpv internals for test
mktemp is good enough for this test purposes and also tests if libmpv is
able to create a file that doesn't exist.
2024-06-03 19:18:06 +02:00
Kacper Michajłow
d70a0b4494 player/playloop: remove now unused get_percent_pos() 2024-06-03 19:16:35 +02:00
Kacper Michajłow
37127276cc win32: quantize taskbar playback position into uint8 range
Also, if the position is valid, set it to 1 / INF. Windows interprets 0
as non-progress.

Progress is quantized into uint8 range, it is good enough for this
use-case. This avoids unnecessary vo_control and
ITaskbarList3::SetProgressValue calls and should be visually
indistinguishable in practice.

Fixes #14282
2024-06-03 19:16:35 +02:00
Kacper Michajłow
d3b251bb99 Revert "d3d11: calc vsync interval on real stats, not just last interval"
The values provided since last disjoint event may include significant
error in case there are periods of slower presentation. We should look
at more localized/current values of presentation.

For more accurate approximation of vsync rate I plan to add better
algorithm to calculate it.

Revert this commit alone as it is not neccessary and gives as separation
from other changes for better regression testing.

This reverts commit f27767f59e.
2024-06-03 19:16:01 +02:00
Guido Cella
e95af5b607 TOOLS/autoload.lua: fix directory_mode and ext options
Operations on option values need to be performed after they are read.

Fixes 843161d96e.
2024-06-03 15:25:51 +02:00
nanahi
cfc651a805 osd: don't use get_percent_pos function
Use get_current_pos_ratio instead, and round the value to integer with
printf precision specifier.
2024-06-03 15:14:40 +02:00
nanahi
b77c5168b4 command: simplify printing floats as integers
For this purpose, the printf precision specifier can be used.
No need to call lrint.
2024-06-03 15:14:40 +02:00
Guido Cella
9fa8101847 README: link to discussions 2024-06-02 22:53:49 +02:00
Guido Cella
525fa85932 osc.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
c5468ba5ff TOOLS/test-hooks.lua: fix lint warning 2024-06-02 22:26:00 +02:00
Guido Cella
3613070380 TOOLS/status-line.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
c28525ac9d TOOLS/osd-test.lua: fix lint warning 2024-06-02 22:26:00 +02:00
Guido Cella
1f356d6784 TOOLS/observe-all.lua: fix lint warning 2024-06-02 22:26:00 +02:00
Guido Cella
5977722adc TOOLS/nan-test.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
c12e437d43 TOOLS/cycle-deinterlace-pullup.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
f3f77353f2 TOOLS/command-test.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
843161d96e TOOLS/autoload.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
44d7100296 TOOLS/autodeint.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
142b75a95f TOOLS/autocrop.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
ee514c6acf TOOLS/ao-null-reload.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
Guido Cella
62868beffe ytdl_hook.lua: fix lint warnings 2024-06-02 22:26:00 +02:00
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