Commit Graph

48942 Commits

Author SHA1 Message Date
sfan5 3d9d041a11 command: expose underlying pixfmt for hwdec 2020-10-16 17:48:05 +02:00
Jan Ekström b8104a013d ci/appveyor: attempt to work around outdated msys2
Based on the workarounds utilized in the MAME project:
1. mamedev/mame@4b4016110a
2. mamedev/mame@2d1bf3ed5c

Co-authored-by: James Ross-Gowan <rossy@jrg.systems>
2020-10-17 00:00:35 +11:00
Jan Ekström 925d6e1205 ci/travis: stop installing mingw-w64 packages manually
As we are now on 20.04, these packages are now available in the
repositories. Additionally, they don't need to be separately pulled
in, as gcc-mingw-w64 already does that.
2020-10-16 00:01:54 +02:00
Jan Ekström 9121e8f513 ci/travis: move to a yaml list for required packages for mingw-w64 2020-10-16 00:01:54 +02:00
Jan Ekström f9ed80a12b ci/travis: bump Ubuntu distro version to focal (20.04) 2020-10-16 00:01:54 +02:00
Philip Langdale 9a1942ac95 manpage: Document behaviour of *nix configuration directories
The original documentation here is unclear, so let's describe the
behaviour we actually have. Inspired by wm4's updated docs but
obviously not identical because we're not changing any of the
behaviours.
2020-10-16 00:47:18 +03:00
Philip Langdale 949e06c86c Revert "path: switch back to using non-XDG config dir by default"
This reverts commit 269f0e743e.
2020-10-16 00:47:18 +03:00
Philip Langdale aa18a8e1cd Revert "path: do not use old_home for win32 exe dir"
This reverts commit c3694f0acb.
2020-10-16 00:47:18 +03:00
Philip Langdale 8a2449e3d5 Revert "manpage: reference standard for configuration file location"
This reverts commit 67b4a96e45.
2020-10-16 00:47:18 +03:00
Jan Ekström 3248b073ce build: bump waf to 2.0.20
There have been mentions that there are apparently some bugs with
regards to possible random build failures, so bumping after a few
years sounds like an OK thing to test/do.
2020-10-16 00:01:23 +03:00
Alexandre Iooss 75acc04262 stream_lavf: enable SRT protocol support through FFmpeg
Additionally, announce support for the protocol in Mac and Linux
application metadata.
2020-10-15 23:53:33 +03:00
Dudemanguy f781c00ece vo_gpu: fix segfault when updating render opts
VOCTRL_UPDATE_RENDER_OPTS is supposed to be optional so check if it
actually exists before executing the function. Fixes a segfault when
changing the alpha value at runtime on non-wayland platforms.
2020-10-15 12:18:59 -05:00
Dudemanguy f5a094db04 vo_gpu: EGL: hack for alpha on different platforms
7fb972f fixed transparency on x11/EGL/Mesa but happened to also break it
for wayland and nvidia. Ideally on wayland, you should just be able to
pick the right EGLConfig that has alpha but this doesn't seem to work
because reasons. So just go back to setting the EGL_ALPHA_SIZE bit if
the user asks for alpha. Apparently this worked before for nvidia as
well. The hack is to just run an eglQueryString in the x11egl context.
If it picks up Mesa as the EGL_VENDOR, then force ctx->opts.want_alpha
to 0 and let pick_xrgba_config take care of the rest.
2020-10-15 13:44:07 +00:00
Dudemanguy b60545bdc6 wayland: update opaque region on runtime
Made possible with 00b9c81. 34b8adc let the wayland surface set an
opaque region depending on if alpha was set by the user or not. However,
there was no attempted detection for runtime changes and it is possible
(at least in wayland vulkan) to toggle the alpha on and off. So this
meant, we could be incorrectly signalling an opaque region if the user
happened to change the alpha. Additionally, add a helper function for
this and use it everywhere we want to set the opaque region.
2020-10-15 13:43:45 +00:00
Dudemanguy aacefa4ae5 vo_gpu: update render options on runtime
vo_gpu has a small set of options for ra_ctx that can be set. In
practice, runtime toggling doesn't matter for most of these as they have
no effect while a video is playing. However, changing the alpha option
during runtime can actually work depending on the backend used. mpv
already detected when one of these options changed, but it made no
attempt to update the options in the ra_ctx accordingly (likely because
nothing made any use of this information). Another related change is to
add an update_render_opts to the fns and allow invidiual backends to
(optionally) use it.
2020-10-15 13:43:45 +00:00
Dudemanguy deaea70630 wayland: be less strict about when to render
efb0c5c changed the rendering logic of mpv on wayland and made it skip
rendering when it did not receive frame callback in time. The idea was
to skip rendering when the surface was hidden and be less wasteful. This
unfortunately had issues in certain instances where a frame callback
could be missed (but the window was still in view) due to imprecise
rendering (like the default audio video-sync mode). This would lead to
the video appearing to stutter since mpv would skip rendering in those
cases.

To account for this case, simply re-add an old heuristic for detecting
if a window is hidden or not since the goal is to simply not render when
a window is hidden. If the wait on the frame callback times out enough
times in a row, then we consider the window hidden and thus begin to
skip rendering then. The actual threshold to consider a surface as
hidden is completely arbitrary (greater than your monitor's refresh
rate), but it's safe enough since realistically you're not going to miss
60+ frame callbacks in a row unless the surface actually is hidden.
Fixes #8169.
2020-10-15 13:36:49 +00:00
Christopher Degawa cfead22b80 wscript_build.py: use -Wl,--subsystem,console instead
Fixes an issue with clang not using the -mconsole option if mwindows
is present resulting in mpv.com being a gui program instead of a
console program.

Does not interfere with gcc compilation.

result without this patch

```
file .\mpv.com .\mpv.exe
.\mpv.com: PE32+ executable (GUI) x86-64 (stripped to external PDB)
.\mpv.exe: PE32+ executable (GUI) x86-64 (stripped to external PDB)
```

both executables open the mpv gui with out console output.

result with this patch

```
file .\mpv.com .\mpv.exe
.\mpv.com: PE32+ executable (console) x86-64 (stripped to external PDB)
.\mpv.exe: PE32+ executable (GUI) x86-64 (stripped to external PDB)
```

mpv.com properly outputs text to console instead of instantly opening
a gui

`, for MS Windows` removed from the end of file outputs to reduce col
count

https://github.com/m-ab-s/media-autobuild_suite/issues/1794

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
2020-10-15 01:28:30 +03:00
Tim Gates 2cfeee68d4 docs: fix simple typo, unminimze -> unminimize
There is a small typo in DOCS/man/options.rst.

Closes #8165
2020-10-14 19:45:52 +00:00
Chris Varenhorst 4797594347 DOCS: fix typo on sub-filter-regex-enable 2020-10-12 03:00:29 -04:00
wm4 67b4a96e45 manpage: reference standard for configuration file location 2020-10-09 19:06:27 +02:00
wm4 16b44d93f7 Revert "demux: add a POS"
This reverts commit 4f18e7927b.

It was a mistake, and barely anyone needs this.
2020-10-08 11:17:10 +02:00
wm4 6de25997a1 player: fix another nightmarish corner case
Pretty much fuck this shit.
2020-10-08 00:36:41 +02:00
wm4 4f18e7927b demux: add a POS
I regret doing this so much, it's fucking garbage.

Fixes: #5100
2020-10-08 00:35:37 +02:00
Dudemanguy 5dc16a4a18 Revert "wayland: add wayland-display-socket option"
Pointless feature that can be done with environment variables. It was
also implemented incorrectly and broke autoprobing.

This reverts commit 015b676875.
2020-10-07 08:41:47 -05:00
Dudemanguy 015b676875 wayland: add wayland-display-socket option
As per the client API, a client can connect to any arbitrary wayland
socket. mpv has always just passed NULL which connected to the
compositor currently in use, but one could just as easily pass the name
of a different socket (i.e. the value of WAYLAND_DISPLAY). Here, we just
expose this argument as a user configurable option. If the user passes a
socket name that does not exist, then print a warning and fall back to
NULL.
2020-10-06 17:45:59 +00:00
wm4 39f4fd0dc7 screenshot: add --screenshot-sw option
Probably worthless. As usual, the manpage dumps all the subtle
differences due to implementation details on the user.
2020-10-05 00:16:46 +02:00
Dudemanguy 34b8adc456 wayland: set an opaque region
Apparently a part of the wayland spec. A compositor may use a surface
that has set part of itself as opaque for various optimizations. For
mpv, we simply set the entire surface as opaque as long as the user has
not set alpha=yes (note: alpha is technically broken in the wayland EGL
backend at the time of this commit but oh well). wlshm is always opaque.
Fixes #8125.
2020-10-01 11:12:22 -05:00
Guido Cella dcec6d9556 options: fix --cover-art-file typo
...which makes it not work.
2020-09-30 17:57:44 +02:00
wm4 e1536193cb player: cosmetically change around some code
Is this better?
2020-09-28 00:14:54 +02:00
wm4 55d7f9ded1 player: add automatic loading of external cover art files
Picks up files like "cover.jpg". It's made part of normal external file
loading, so I'm adding 3 new options that are direct equivalents for the
options that control loading of external subtitle and audio files. Even
though I bet nobody wants them and they just increase confusion... I
guess the world is actually hell, so this outcome should be fine.

It prefers non-specific external files like "cover.jpg" over embedded
cover art. Not sure if that's wanted or unwanted.

There's some pain over explicitly marking such files as external
pictures. This is basically an optimization: in most cases, a heuristic
would treat an image file loaded with --external-file the same (it's a
heuristic because ffmpeg can't tell us whether something is an image or
a video). However, even with this heuristic, it would decode the cover
art picture again on each seek, which would essentially slow down
seeking in audio files. This bothered me greatly, which is why I'm
adding these additional options at all, and bothered with the previous
commit.

Fixes: #3056
2020-09-28 00:12:52 +02:00
wm4 102a4a8b06 player: let frontend decide whether to use cover-art mode
Essentially, this lets video.c decide whether to consider a video track
cover art, instead of having the decoder wrapper use the lower level
sh_stream flag.

Some pain because of the dumb threading shit. Moving the code further
down to make some of it part of the lock should not change behavior,
although it could (framedrop nonsense).

This commit should not change actual behavior, and is only preparation
for the following commit.
2020-09-28 00:04:21 +02:00
sfan5 5e4ec15e6c ci: fix spirv-cross build in mingw scripts 2020-09-25 18:23:05 +02:00
der richter 82eda2e5f8 mac: add support for the focused property 2020-09-25 16:48:24 +02:00
der richter 18a35f17e2 mac: add an option to prevent focusing of the window on open
on macOS 10.15 setting the activation policy behaves quite weirdly. the
call changes the current active App to a nameless process, which
probably also the reason that prevents the not focusing to work.
a workaround for that, is to refocus the previous active app.

Fixes #7725
2020-09-25 16:48:24 +02:00
der richter c535dfed66 travis: fix macOS 10.12 legacy build
brew update tries to update the java cask, which it tries to build from
source. this takes too long and leads to a timeout of the job. we can't
manually remove the java cask because of a bug in the too old brew cask
version and the old formula. we just remove the whole cask tap and call
it a day, since we don't need it anyway.
2020-09-22 13:03:39 +02:00
Dudemanguy efb0c5c446 wayland: only render if we have frame callback
Back in the olden days, mpv's wayland backend was driven by the frame
callback. This had several issues and was removed in favor of the
current approach which allowed some advanced features (like
display-resample and presentation time) to actually work properly.
However as a consequence, it meant that mpv always rendered, even if the
surface was hidden. Wayland people consider this "wasteful" (and well
they aren't wrong). This commit aims to avoid wasteful rendering by
doing some additional checks in the swapchain. There's three main parts
to this.

1. Wayland EGL now uses an external swapchain (like the drm context).
Before we start a new frame, we check to see if we are waiting on a
callback from the compositor. If there is no wait, then go ahead and
proceed to render the frame, swap buffers, and then initiate
vo_wayland_wait_frame to poll (with a timeout) for the next potential
callback. If we are still waiting on callback from the compositor when
starting a new frame, then we simple skip rendering it entirely until
the surface comes back into view.

2. Wayland on vulkan has essentially the same approach although the
details are a little different. The ra_vk_ctx does not have support for
an external swapchain and although such a mechanism could theoretically
be added, it doesn't make much sense with libplacebo. Instead,
start_frame was added as a param and used to check for callback.

3. For wlshm, it's simply a matter of adding frame callback to it,
leveraging vo_wayland_wait_frame, and using the frame callback value to
whether or not to draw the image.
2020-09-21 20:42:17 +00:00
wm4 9ba90b4f6f player: add pause state to playback start message
Now the player tells you that audio or video are playing while paused,
or something.
2020-09-21 19:36:25 +02:00
wm4 95e3a6e67e terminal: fix segfault when backgrounding
In the recent terminal commit, I "compressed" the read() error handling,
and messed it up. The return value could be -1 for other non-fatal
errors (such as EIO when trying to read while backgrounded), which
resulted in buf.len getting messed up.

Fixes: 602384348e
2020-09-21 19:31:15 +02:00
wm4 1f21be343a f_decoder_wrapper: make log prefix less verbose 2020-09-20 21:33:40 +02:00
sfan5 63ffa07b44 audio: take paused state into account in ao_start()
It makes no sense to instruct the AO to start the pull callbacks
when we know there's nothing to play (only affects pull AOs).
2020-09-20 18:52:54 +02:00
sfan5 c1db4630e6 audio: move start() calls outside of lock
Pull based AOs might want to call ao_read_data() inside start().
This fixes ao_opensles deadlocking.
2020-09-20 18:52:54 +02:00
der richter 03047a0169 mac: add an option to change the App activation policy
useful to hide the app icon in the Dock if necessary.
2020-09-20 15:28:50 +02:00
der richter e28724d90d mac: add ontop window level for desktop
this puts the window ontop of the desktop but behind the desktop icons.

Fixes #7791
2020-09-20 15:28:50 +02:00
sfan5 3054bcc62c options: simplify --android-surface-size handling 2020-09-20 12:04:25 +02:00
wm4 7831e52238 build: disable GLX
Nobody needs this anymore. If not too many people complain, we'll remove
this completely. Many already consider X11 and OpenGL legacy, so we
don't need TWO X11/OpenGL backends.
2020-09-18 15:17:07 +02:00
Guido Cella a7afc79d8f manpage: fix console keybindings punctuation 2020-09-18 14:29:04 +02:00
wm4 fb3facf052 msg: make --msg-time show time in seconds
More readable, similar to what --log-file will use (although the
terminal code shows microseconds and uses less left padding).
2020-09-18 14:26:41 +02:00
Philip Sequeira f4c39c74d4 build: sort dependencies (to make build deterministic)
Fixes #7855.
2020-09-18 02:02:49 +00:00
wm4 9806e9f82b command, demux: make drop-buffers reset state even harder
Leave nothing left when it's executed.
2020-09-17 15:34:40 +02:00
wm4 602384348e terminal: attempt to handle the ESC key
Due to Unix being legacy garbage, it's not possible to safely detect the
ESC key on terminal. The key sequences are ambiguous. The code for the
ESC key also starts the sequences for other special keys.

Until now, you needed to hit ESC twice for it to be recognized.

Attempt to handle this better by using a timeout to detect the key. If
ESC is in the input buffer, but nothing else arrived after a timeout,
assume it's the ESC key. I think this is the method vim uses. Currently,
the timeout is set at 100ms. This is hardcoded and cannot be changed.
It's possible that this causes problems on slow ssh connections or so.

I'm not sure what exactly happens if you manage to get ESC + another
normal key into the input buffer. If it's a known sequence, it will be
matched and interpreted as such. If not, it'll probably be discarded.
2020-09-17 15:31:19 +02:00