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.
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.
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.
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
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.
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)
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.
Includes cleanup of CFBundleDocumentTypes, UTImportedTypeDeclarations,
LSItemContentTypes. Reordered general structure of the Property List as
in nodes/collections/arrays. Declared MIME types.
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.
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
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.
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.
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.
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.
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.