| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
ffmpeg is again setting the frame dimensions to the coded size, so we
need to reintroduce our work-around to get the logical frame dimensions
from the frames_ctx rather than the frame itself.
ffmpeg commit:
* https://github.com/FFmpeg/FFmpeg/commit/9ee4f47c94083b4fe38d4e217a7d65055d3ad53f
This reverts commit c40bd888729212f698156b57e49391d3b51f8f07.
|
| |
|
|
|
|
|
|
| |
Other similar options are in the form of --foo-override not
--override-foo. The display-fps one was backwards so flip it around the
other way for consistency reasons.
|
|
|
|
|
|
| |
Peak detection greatly increases HDR experience. Performance hit of
non-delayed detection is not that significant and is in line with
current default settings.
|
|
|
|
|
|
|
| |
Make it not possible to build mpv without the latest libplacebo anymore.
This will allow for less code duplication between mpv and libplacebo,
and in the future also let us delete legacy ifdefs and track libplacebo
better.
|
|
|
|
| |
Also sanitize vsync values, just in case.
|
| |
|
|
|
|
| |
Improves averaging on high refresh rate displays.
|
| |
|
|
|
|
| |
these are defined in osdep/endian.h already
|
|
|
|
| |
the variable `w` is unused as a whole.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
since i was going to fix the include order of stdatomic, might as well
sort the surrouding includes in accordance with the project's coding
style.
some headers can sometime require specific include order. standard
library headers usually don't. but mpv might "hack into" the standard
headers (e.g pthreads) so that complicates things a bit more.
hopefully nothing breaks. if it does, the style guide is to blame.
|
|
|
|
|
|
|
|
|
|
|
| |
the fallback needed it due to the struct wrapper. but the fallback is
now removed so it's no longer needed.
as for standard atomics, it was never really needed either, was useless
and then made obsolete in C17 and removed in C23.
ref: https://gustedt.wordpress.com/2018/08/06/c17-obsoletes-atomic_var_init/
ref: https://en.cppreference.com/w/c/atomic/ATOMIC_VAR_INIT
|
|
|
|
|
|
|
| |
replace it with <stdatomic.h> and replace the mp_atomic_* typedefs with
explicit _Atomic qualified types.
also add missing config.h includes on some files.
|
|
|
|
| |
So it is not lost after filtering.
|
|
|
|
|
| |
May increase performance, especially when using DR with a dedicated
transfer queue.
|
|
|
|
| |
Fixes: https://github.com/mpv-player/mpv/issues/12672
|
|
|
|
| |
Needed for odd formats like rgb24.
|
| |
|
| |
|
|
|
|
|
| |
Both buffers have the same size (32) and if the source is not null
terminated it should be fixed there. Copy whole buffer.
|
|
|
|
|
|
|
|
|
| |
Some users report visible black frames during window resize, this should
not happen in most cases. Let's just keep stale content as it is less
distracting. While still clearing on first window paint to avoid white
background.
Fixes: #12642
|
|
|
|
|
| |
Since the previous commit unbreaks the timeout, this now actually works.
Imagine that.
|
|
|
|
|
|
| |
Added in 58a7d81dc55835fb0f5cc6a3f14288d722f83c91. Nobody touched it
since then, so it's probably useless. libplacebo has its own dithering
stuff anyways.
|
| |
|
|
|
|
|
|
|
| |
There's a lot of wild 1e6, 1000, etc. lying around in the code. A macro
is much easier to read and understand at a glance. Add some helpers for
this. We don't need to convert everything now but there's some simple
things that can be done so they are included in this commit.
|
|
|
|
|
|
|
|
| |
add support for vulkan through metal and a translation layer like
MoltenVK. also add the possibility to use different render timing modes
for testing.
i still consider this experimental atm.
|
|
|
|
|
|
|
| |
add an animation lock to the window to prevent the window from closing
while animating. if this is done while the fs animation is running the
dock will stay hidden. this is not used yet, because it's unnecessary
for cocoa-cb but will be for new vo backends.
|
|
|
|
|
|
| |
Fixes type mismatch after recent changes.
Fixes: 59dd7d94af7651baf7e60966c5f8e7d52959d958
|
|
|
|
|
| |
While the video playing, it's not actually needed and can cause
unnecessary redraws. Fixes #12623.
|
|
|
|
| |
same rationale as last commit
|
|
|
|
|
|
|
|
|
|
|
| |
Several window resizing operations (i.e., --auto-window-resize,
border dragging with --keep-aspect-window, Alt+0/1/2) cause the
window to detach from the snapped borders. This patch resolves
this by recording to which borders the window is snapped, and
using this info to determine how the window should be placed after
resizing.
Closes https://github.com/mpv-player/mpv/issues/6588
|
|
|
|
|
|
|
|
|
|
|
| |
Linux and macOS already use nanosecond resolution for their sleep
functions. It was just being converted from microseconds before. Since
we have mp_time_ns now, go ahead and bump the precision here. The timer
for windows uses some timeBeginPeriod thing which I'm not sure what it
does really but whatever just convert the units to ms like they were
doing before. There's really no reason to keep the mp_sleep_us helper
around. A multiplication by 1000 is trivial and underlying OS clocks
have nanosecond precision.
|
|
|
|
|
|
|
|
|
|
| |
On linux, several platforms poll for events over a fd. This has ms
accuracy, but mpv's timer is in ns now so lots of precision is lost. We
can use an mp_poll wrapper to use ppoll instead which takes a timespec
directly with nanosecond precision. On systems without ppoll this falls
back to old poll behavior. On wayland, we don't actually use this
because ppoll completely messes up the event loop for some unknown
reason.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many cases, this is purely cosmetic because poll still only accepts
microseconds. There's still a gain here however since
pthread_cond_timedwait can take a realtime ts now.
Additionally, 37d6604d70c8c594de2817db26356c4c950ac0fd changed the value
added to timeout_ms in X11 and Wayland to ensure that it would never be
0 and rounded up. This was both incomplete, several other parts of the
player have this same problem like drm, and not really needed. Instead
the MPCLAMP is just adjusted to have a min of 1.
|
| |
|
|
|
|
|
| |
This is weird. The caller should be responsible for converting the value
if desired. Move the conversion to player/command.c instead.
|
|
|
|
|
| |
This timing dependency does not guarantee that we will wake up in the
future, depending on processing times.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vo_still_displaying() is racey with vo_request_wakeup_on_done() and above
that it doesn't work as expected. VO can run out of work and go to sleep
for 1000s, while the play thread still returns on vo_still_displaying()
check, because of a check `now < frame_end` so it never advances and go
to sleep itself.
This fixes dead lock that we have when image parameters changes during
playback.
This reverts commit 0c9ac5835be70ae26e4aa875e833fe2c7b3b3bf3.
Fixes: #12575
|
|
|
|
|
|
| |
It is already set above.
Fixes: #12577, #12587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fbe154831a8addfc18a4f81e1c4b9284c31acace added a new VOCTRL to signal
when the OSD changed for gpu-next's handling of subtitles, but this is
both not necessary and actually incomplete. The VOCTRL would signal OSD
changes, but not all subtitle changes (like selecting another
non-external sub track for example). VOCTRL_OSD_CHANGED was used to
increment p->osd_sync which would then redraw the blended subtitles if
the player was paused.
But there's already a VOCTRL_PAUSE and VOCTRL_RESUME. Plus, the
sub_bitmap_list object will have items in it if it changed in any way,
so we don't need the VOCTRL_OSD_CHANGED method at all. That can be
removed.
The check that fp->osd_sync < p->osd_sync stays in place since that's an
optimization while the video is playing, but we also check the pause
state as well since the VO can know this. If we're paused, then always
do update_overlays since core must be signalling a redraw to us if we
get a draw_frame call here. Additionally in update_overlays itself, the
p->osd_sync counter is incremented if we have any items since the frame
signature will need that. As for the actual bug that is fixed, changing
subtitle tracks while paused with blended subtitles now correctly works.
Previously, it was never updated so the old subtitle stayed there
forever until you deselected it (since VOCTRL_OSD_CHANGED triggered
there).
Also include some cosmetic code fixes that were noticed.
|
|
|
|
|
|
|
|
|
|
|
| |
The current calculation makes the implicit assumption that the margins
on both sides are always equal (the 2 times multiplication). This isn't
true though. For example, a 720p video fullscreened on a 1680x1050
display will have a top margin of 52 but a bottom margin of 53. The
current calculation just multiplies 52 by 2, so it's off by one. Fix
this by adding together all the margins together (left + right or top +
bottom) then adding that to the dst window size (width or height). This
way, we get the full size of the window for the viewport. Fixes #12554.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes white background appearing for short period of time before
first frame is drawn. Clear to black as this is way less distracting
than bright white flash.
Borderless window and fullscreen seems to be initially not
drawn/transparent, so no need to clear it to black. Only when
decorations are enabled (--border) the issue happens.
Fixes: #12549
|
|
|
|
|
|
| |
Forgotten in 7b8a30fc8132203bc93d35ac887682d2044ad5a9. Every other case
either is either a dummy frame (no allocated memory) or we manage it as
part of the usual wayland buffer release.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When implementing vo_dmabuf_wayland, it always did a copy of the image
from the current frame and worked with that. The reason was because
mpv's core held onto the frame and caused some timing issues and
rendering glitches depending on when it freed the image. This is pretty
easy to fix: just make vo_dmabuf_wayland manage the the frames. In vo.h,
we add a boolean that a VO can set to make them manage freeing frames
directly. After doing this, change the buffers in vo_dmabuf_wayland to
store the whole vo_frame instead of just the image. Then, just modify
some things a bit so frame is freed instead of the image. Now, we should
truly have zero-copy playback. Well as long as you don't use libass to
render anything (that's still a copy from system memory).
|
|
|
|
| |
We have to support all changing states, not only borderless.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
e125da2096d97ec7e64701bf6289705a24c31729 changed the z order of the
surfaces a bit, but it turns out this has a side effect. If the aspect
ratio of the actual video doesn't match your display, the osd surface
doesn't scale properly and gets clipped. Put the z ordering back where
it used to be. Instead when we have the force window case, simply attach
the already existing solid buffer to the video surface. This allows the
osd surface to actually draw over it instead of always being obscured so
it satisfies the case of not having any real video frames but still
wanting to draw the osd. Also don't mess with any of the viewport source
setting stuff with force window. Weston complains about it, and it's
nonsensical anyway. Fixes #12547.
|
|
|
|
|
|
| |
Fixes window resizing in borderless mode after adding WS_SYSMENU.
Fixes: 172d9be3005c6a85f4f139f1dedccefe26ea8d91
|
|
|
|
|
|
|
|
|
|
|
|
| |
0739cfc20934ac7772ab71dbae7ecba4ba10fda4 added the draw_frame API
deprecated draw_image internally. VOs that still used draw_image were
around, but really there's no reason to not just "upgrade" them anyway.
draw_frame is what the "real" VOs that people care about (gpu/gpu-next)
use. So we can just simplfy the code a bit now. VOCTRL_REDRAW_FRAME is
also no longer needed so that can be completely deleted as well. Note
that several of these VOs are legacy crap anyway (e.g. vaapi) and maybe
should just be deleted but whatever. vo_direct3d was also completely
untested (not that anyone should ever use it).
|
|
|
|
|
|
| |
Fixes missing icon when initial window is created without caption.
Fixes: #12472
|
|
|
|
|
|
|
|
| |
This causes only problems, because we convert mp_time to realtime, which
is not atomic, so we introduce error. And even though on sane platforms
it should work fine, after all the sleep time is in the past.
winpthreads like to sleep for like over 10ms when the time is less than
current time, but not more than 1s.
|
|
|
|
| |
High refresh rate displays exists...
|
|
|
|
|
| |
There is no reason to use microseconds precision. We have precise timers
all all relevant platforms.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In practice, most compositors implement the rotation clockwise which
matches mpv's option, but amusingly this is actually incorrect.
According to the spec*, wayland buffer rotations are counter-clockwise.
So with this assumption in mind, in order for the rotation to match
mpv's usual semantics, the 90 degree and 270 degree positions need to be
flipped. Of course, this will make the VO rotate the wrong way on most
compositors, but this is what the spec says (sway master is known to
currently be correct). Fixes #12508 (sort of but will break the rotation
direction on other compositors. Oh well).
*: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_output-enum-transform
|
|
|
|
|
|
|
|
|
| |
NV16 is the half subsampled version of NV12 format. Decoders which
support High 4:2:2 of h264 provide the frame in NV16 format to establish
richer colorspace. Similar profiles are also available in HEVC and other
popular codecs. This commit allows NV16 frames to be displayed over
drmprime layers.
Signed-off-by: hbiyik <boogiepop@gmx.com>
|
|
|
|
|
|
|
|
| |
Calling wl_display_disconnect closes the file descriptor, no need to
manually do it ourselves beforehand which causes a double close on the
fd.
Signed-off-by: Jack Mitchell <jack.mitchell@tuxable.co.uk>
|
| |
|
|
|
| |
uses the same mechanic as for x11
|
|
|
|
|
|
|
| |
Pointless bloat option, hard-coded as 256 now in libplacebo and no
reason not to also hard-code in mpv.
See-Also: haasn/libplacebo@64d7c5aab06766a9492d3cfffd35333792052cd9
|
|
|
|
|
|
|
| |
Pointless bloat option, hard-coded as 1e-3 now in libplacebo and no
reason not to also hard-code in mpv.
See-Also: haasn/libplacebo@64d7c5aab06766a9492d3cfffd35333792052cd9
|
|
|
|
|
|
|
| |
Unbelievably, mutter actually supports the idle inhibit protocol now
after many years of pain*. Let's remove this hacky warning.
*: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3145
|
|
|
|
| |
Also change a ta_free to talloc_free for consistency reasons.
|
|
|
|
| |
Gets rid of yet another mp_read_option_raw call.
|
| |
|