Commit Graph

48037 Commits

Author SHA1 Message Date
wm4 04bde06095 stream_libarchive: some more hacks to improve multi-volume archives
Instead of opening every volume on start just to see if it's there, all
all volumes that could possibly exist, and "handle" it on opening. This
requires working around some of libarchive's amazing stupidity and using
some empirically determined behavior. Will possibly break if libarchive
changes some of this behavior.

See: #7182
2020-01-04 18:59:23 +01:00
wm4 657ce1b15c stream_libarchive: enable rar5 support
We whitelist formats (and not all of them). RAR v5 is a separated format
entry for inexplicable reasons. (It's a separate implementation, but who
really wants to support only either of the rar formats?)

I'm not sure if it was libarchive 3.3.3. Their git history is absolutely
chaotic. These people do not know how to use git. I couldn't be bothered
to dig deeper.
2020-01-04 17:15:09 +01:00
wm4 99700bc52c demux_edl: restore relative path resolution
Playing e.g. "dir/f.edl" should make all non-absolute paths in f.edl
relative to "dir".

Commit 0e98b2ad8e accidentally broke this.
2020-01-02 23:31:02 +01:00
Philip Langdale daa125cb45 osc: reset input handling state on a change in visibility mode
Currently, the activation and deactivation of input handling is done
inside the render() loop, but this does not run when the osc mode is
`never` - which does make sense.

That means that if you are cycling the visibility mode, the input
state will be whatever it was at the time of the mode change. And,
as our modes are ordered `auto` -> `always` -> `never`, the input
state will be enabled when you cycle to `never`.

There are various ways you can imagine fixing this, and in this
change I propose we reset the input state to disabled on a mode
change, and then let render() re-enable input if that's appropriate.

Fixes #7298.
2020-01-02 07:32:57 -08:00
Dudemanguy 5feee11e43 wayland: disable by default for gnome
It turns out that gnome wayland still has very serious issues that make
it unusable for playback with mpv. Other compositors mostly behave fine
(Plasma is just missing feature but it's not seriously broken), so GNOME
gets the special honor of having a warning printed out. The only
solution for GNOME users at this time of writing is to either use the
Xorg session or use another wayland compositor.
2020-01-01 20:27:54 +00:00
Dudemanguy 7d08491cd9 Revert "vo_gpu: move wayland below X11 in autoprobe order"
This reverts commit a6d8e9b7ff.
2020-01-01 20:27:54 +00:00
wm4 934f8e1026 Bump copyright year
Merry Christmas or whatever it fucking is now.
2019-12-31 17:10:46 +01:00
wm4 3b6c4e7be1 demux: make track switching instant with certain mpegts files
When switching tracks, the data for the new track is missing by the
amount of data prefetched. This is because all demuxers return
interleaved data, and you can't just seek the switched track alone.
Normally, this would mean that the new track simply gets no data for a
while (e.g. silence if it's an audio track). To avoid this, mpv performs
a special "refresh seek" in the demuxer, which tries to resume demuxing
from an earlier position, in a way that does not disrupt decoding for
the non-changed tracks. (Could write a lot about the reasons for doing
something so relatively complex, and the alternatives and their
weaknesses, but let's not.)

This requires that the demuxer can tell whether a packet after a seek
was before or after a previously demuxed packet, sort of like an unique
ID. The code can use the byte position (pos) and the DTS for this. The
DTS is normally strictly monotonically increasing, the position in most
sane file formats too (notably not mp4, in theory).

The file at hand had DTS==NOPTS packets (which is fine, usually this
happens when PTS can be used instead, but the demux.c code structure
doesn't make it easy to use this), and pos==-1 at the same time. The
latter is what libavformat likes to return when the packet was produced
by a "parser" (or in other words, packets were split or reassembled),
and the packet has no real file position. That means the refresh seek
mechanism has no packet position and can't work.

Fix this by making up a pseudo-position if it's missing. This needs to
set the same value every time, which is why it does not work for
keyframe packets (which, by definition, could be a seek target).

Fixes: #7306 (sort of)
2019-12-31 00:17:46 +01:00
Chris Down b721f9d095 configfiles: Fix utime retcode check
In final fixups for #7139 it seems I managed to screw up utime error
checks. Everything still works, but we MP_WARN when we don't need to.
2019-12-31 00:17:07 +01:00
wm4 fcf0b80dc9 player: make unpausing directly after seek work with --keep-open
When using --keep-open, and the end of the file is reached, the player's
"pause" property is set to true. Attempting to set it to false reverts
it back to true immediately. That's how it's designed, for better or
worse.

Running "seek -10 ; set pause no" did not work, because the seek is
first queued and pause is unset, but then the decoding functions
determine that EOF is still a thing, and "mpctx->stop_play =
AT_END_OF_FILE;" is set again. handle_keep_open() then sets pause again.
Only then the seek is actually run.

Fix this by not setting stop_play if a seek is queued.
2019-12-30 17:40:21 +01:00
wm4 a6d8e9b7ff vo_gpu: move wayland below X11 in autoprobe order
I'm sick of mpv being accused of not doing it right.
You can't do it right on Wayland? Long live X11.

Fixes: #7307
2019-12-30 13:12:33 +01:00
Philip Langdale 5fcad696a9 manpage: update discussion of nvidia hardware acceleration
The text here has become somewhat outdated over the years, and it's
worth updating to reflect the current situation.
2019-12-29 15:09:46 -08:00
Philip Langdale 9c05be8999 video: cuda: add explicit context creation for copy hwaccels
In the distant past, the cuviddec backed copy hwaccel could be
configured directly using lavc options. However, since that time,
we gained support for automatic hw ctx creation which ended up
bypassing the lavc options.

Rather than trying to find a way to pass those options again, a
better idea is to make the 'cuda-decode-device' option, used by
the interop hwaccels, work for the copy hwaccels too.

And that's pretty simple: we have to add a create function that
checks the option and passes it on to ffmpeg.

Note that this does require a slight re-jig to the configuration
flags, as we now have a scenario where we want to build with support
for the cuda copy hwaccels but not the interop ones. So we need
a distinct configuration flag for that combination.

Fixes #7295.
2019-12-29 14:32:47 -08:00
wm4 f0d0822595 demux: fix --stream-record runtime change handling
Well, if that wasn't particularly dumb.
2019-12-29 20:18:35 +01:00
der richter 0737d842b0 build: actually remove MediaPlayer sources from build when disabled
a small oversight on my side when i added the new flag to fix an include
problem for the vo_sub_opts struct.
2019-12-29 18:43:58 +01:00
Philip Langdale 49cbc5017c vo_gpu: hwdec_vaegl: remove support for old-style interop
In vaapi 1.1.0 (which confusingly is libva release 2.1.0), they
introduced a new surface export API that is more efficient, and
we've been supporting that and the old API ever since (Feb 2018).

If we drop support for the old API, we can do some fairly nice cleanup
of the code.

Note that the pkgconfig entries are explicitly versioned by the API
version and not the library version. I confirmed the upstream pkgconfig
files.
2019-12-28 14:31:34 -08:00
Philip Langdale eb852dc50c vo_gpu: hwdec_vdpau: remove direct_mode
As we are less and less interested in vpdpau, with nvdec and vaapi
being better choices in general on nvidia and AMD respectively, we
might consider removing direct_mode, where we bypass the vdpau
mixer and work directly with yuv textures. Normally, working with
yuv textures would be great, but vdpau built in an assumption that
all frames are delivered as separate fields, causing us to have
to re-interleave them.

nvidia then introduces a new OpenGL extension that can return the
yuv frames as frames, but we can't just unconditionally switch to
that as we'd want to keep supporting older hardware where the drivers
are no longer getting new features. The end result is that we
wouldn't be able to get rid of the old code paths.

Removing direct_mode means we always use the mixer, and work with
rgba frame textures. There are some theoretical limitations to
this, but in practice they probably don't matter much - unsupported
colourspaces don't matter because without 10bit decoding support,
we can't use them anyway, and apparently we're not doing separate
chroma scaling these days, so scaling the rbga doesn't really lose
anything (and the vdpau hq scaling option remains available).
2019-12-28 14:31:06 -08:00
wm4 5a26150717 command: add a playlist-unshuffle command
Has a number of restrictions.

See: #2491, #7294
2019-12-28 21:32:15 +01:00
wm4 582f3f7cc0 playlist: change from linked list to an array
Although a linked list was ideal at first, there are cases where it
sucks, and became increasingly awkward (with the mpv command API
preferring integer indexes to access the list). In future, we probably
want to add more playlist-related functionality, so better change it to
an array now.

An array isn't always ideal either. Since playlist entries are still
separate objects (because in some cases you need a stable "iterator" to
it), but you still need to efficiently get the next/previous playlist
entry, there's a pl_index field, that needs to be maintained. E.g.
adding an entry at the start of the playlist => update the pl_index
field for all other entries. Well, it's not really worth to do something
more complicated to avoid these things.

This commit is probably buggy as shit. It's not like I bothered to test
everything. That's _your_ role.
2019-12-28 21:32:15 +01:00
wm4 4564a22d13 ta: add another funny macro 2019-12-28 21:32:15 +01:00
wm4 65337c032f ta: document funny macros 2019-12-28 21:32:15 +01:00
der richter e2c6919da0 travis: fix python3 for macOS machines
python3 couldn't be set up as system default because it was blocked by
the old python2.
2019-12-28 21:10:08 +01:00
Oliver Freyermuth 1571276d64 stream_dvb: Remove implicit fallthroughs and consistify debug messages.
The code is more explicit now and less confusing,
and debug messages for the channel parsing for the several delivery systems
are now more similar.
2019-12-28 19:16:07 +01:00
James Ross-Gowan c4600394d4 w32_common: remove implicit fallthrough
GCC 9.2 warns about this. It was always a bit sketchy, so get rid of it.
VK_F10 generates WM_SYSKEYDOWN, so it only needs to be handled in the
WM_SYSKEYDOWN case.
2019-12-29 02:30:31 +11:00
Sai Ke WANG 01de2a9bd5 lua: fix mp.file_info for large files
`size` field with `unsigned int` was truncated to 4GB

Signed-off-by: wm4 <wm4@nowhere>
2019-12-28 14:34:32 +01:00
sfan5 13b8363c47 Update VERSION 2019-12-28 12:11:35 +01:00
sfan5 091aa96c4d
Release 0.31.0 2019-12-28 12:07:07 +01:00
wm4 499a41ea35 DOCS/tech-overview.txt: some more blabla
This file is only complete once it contains the entire mpv source code
in English form.
2019-12-28 10:09:28 +01:00
wm4 025e77eaf1 audio: react to --ao and --audio-buffer runtime changes
Before this commit, runtime changes were only applied if something else
caused audio to be reinitialized. Now setting them reinitializes audio
explicitly.
2019-12-27 17:56:22 +01:00
wm4 0c0c373844 m_option: fix runtime changing of --audio-channels
This option type, used by --audio-channels, had a completely broken
m_option_type.equal implementation, and thus reacted incorrectly to
runtime option changes.

Broken since commit b16cea750f.
2019-12-27 17:44:33 +01:00
wm4 2a7e17fe4e DOCS/tech-overview.txt: add lots of irrelevant blabla
Thought it might be useful to document some of these things, instead of
explaining them over and over again. But I can guarantee that nobody
will ever read all this. (Independent of its quality and completeness.)
2019-12-27 17:09:47 +01:00
der richter 1caa653f2d cocoa-cb: force redraw when screen or size changes
in certain circumstances the video was not redrawn even when the size
or the backing scale factor changed. this could lead to a lower
resolution output than intended.

now it redraws the video when screen properties or the window size
changes.
2019-12-24 21:51:24 +01:00
der richter d9e13f42b8 cocoa-cb: implement hidpi scale reporting 2019-12-24 21:51:24 +01:00
wm4 8e9644761a console: add a basic help command
It's not really great. But I think it's good enough to save someone
who's lost. Most importantly, it should become obvious _what_ the
console expects (input commands), and how to exit it.

Would be nice if we could show some documentation, or give a link to
documentation, but that's out of scope and/or not easy.

I considered implementing the "help" command as builtin command in
command.c. On the other hand, this could not show console.lua specific
help, so I implemented it in console.lua. The ad-hoc command parsing
(that sort-of mirrors mpv input command syntax) for the "help" command
is probably the worst part of this.
2019-12-24 16:08:04 +01:00
wm4 1d2fcb9227 console: do not strip leading spaces
As suggested by TheAMM and avih.
2019-12-24 16:04:00 +01:00
wm4 029bb593e7 command: extend command-list output
Add some very basic information about arguments.
2019-12-24 16:03:16 +01:00
wm4 b6d7d246fe manpage: fix example in --hwdec section 2019-12-24 16:02:49 +01:00
wm4 b9084dfd47 stats: do not use "tick" event
It's deprecated. The new solution works almost exactly the same way
(since the still existing internal tick event triggers vsync-jitter
change command), though as far as API usage goes, it's somewhat
questionable. (The comment is meant to discourage anyone trying to copy
the idea for external scripts.)
2019-12-24 16:02:24 +01:00
Niklas Haas f868052872 build: force bootstrap.py to use python3
The script fails running successfully with python2.
2019-12-24 12:22:36 +01:00
wm4 2636bbbf33 osc: redraw on visibility option runtime changes
This affects behavior when using the "del" default key binding.
Sometimes, setting visibility to always did not draw it correctly. This
probably fixes it.
2019-12-24 09:50:08 +01:00
wm4 67650446b5 vd_lavc: remove hwdec-by-default special case for RPI 2019-12-24 09:24:56 +01:00
wm4 380f01567d vd_lavc: more hwdec autoselect nonsense
Add an "auto-safe" mode, mostly triggered by Ubuntu's nonsense to force
hwdec=vaapi in the global config file in their mpv package. But to be
honest it's probably something more people want.

This is implemented as explicit whitelist. On Windows, HEVC/Intel is
sometimes broken, but it's still whitelisted, and in theory we'd need a
detailed whitelist of device names etc. (like for example browsers tend
to do). On OSX, videotoolbox is a pretty bad choice, but unfortunately
the only one, so it's whitelisted too. There may be a larger number of
hwdec wrappers that work anyway, and I'm for example ignoring Android.
2019-12-24 09:24:22 +01:00
der richter e7add205d8 build: fix build with disabled swift and Media Player
when swift is disabled some headers are not included. one of them is the
options/options.h header that is needed for the vo_sub_opts struct. we
include it to fix the build without swift.

the second problem is the build time check for the macOS 10.12.2
features or more specific the Media Player support. since it is a swift
feature we can not use it when swift is disabled. add a separate
Media Player check that also depends on swift and use that new
preprocessor variable as a build time check instead.

Fixes #7282
2019-12-23 23:44:20 +01:00
Avi Halachmi (:avih) 9f2fda7d85 js: support mp.create_osd_overlay (match 07287262)
The legacy mp.set_osd_ass(...) is still supported (but also still
undocumented) as a wrapper for the new mp.create_osd_overlay(...).
2019-12-23 17:52:34 +02:00
Avi Halachmi (:avih) 5a74bf5f95 js: batch key bindings updates (match 96932fe7)
Implemented using one-time idle observer (i.e. setTimeout), to avoid
additional function call(back) every time the event loop enters idle.

The lua mp.flush_key_bindings() is also available, also undocumented.
2019-12-23 17:52:34 +02:00
Nicolas F 7ed70f925b osc: add option to disable santa hat
A minority of users have expressed a dislike of hats, calling them
"cancer [that] don't belong in software" describing the people who add
them as "shitty circlejerks" and "chucklefuck."

While I personally disagree with those opinions, it's probably easier
to let them have it their way. For that reason this adds the option
`greenandgrumpy` to the osc, which allows users to disable the hat.
2019-12-23 16:38:41 +01:00
wm4 091ee9d770 lua: fix guard against division by 0
This was incorrectly converted from the original C code. Change it to
what the original code used.
2019-12-23 16:10:06 +01:00
wm4 d951a7f021 lua: fix passing non-integers to mp.set_osd_ass()
libass uses integers for PlayResX/Y, so the osd-overlay command also
does. Lua (pre-5.3) does not have an integer type, but the command
interface makes a difference anyway. If you pass a Lua number with a
fractional part to an integer parameter (using mp.command_native()), it
will result in an error and complain about incompatible types.

I think that's fine, but since this behavior extends to
mp.set_osd_ass(), this is a compatibility problem.

Fix this by explicitly coercing the resolution parameters to integer
numbers.
2019-12-23 13:23:10 +01:00
wm4 86d24b069b osc: set an arbitrary high Z-order
The main reason for this is just to make show the OSC always above
console.lua, instead of a random order.

(And this is also the only reason osc.lua was changed to the new API.
The old API could have been extended, but lets not.)
2019-12-23 12:06:33 +01:00
wm4 490b3ba007 osc: use new overlay API
This tries to avoid the update() call if nothing changed. This brings it
more into line with the old code (the osd-overlay command simply does
not skip the update if nothing changed). I don't know whether this
matters; most likely not. Normally, code should try to avoid redundant
updates on its own, so it's not the job of the command. However, for the
OSC we simply want to reduce the differences.
2019-12-23 11:48:16 +01:00