Commit Graph

44839 Commits

Author SHA1 Message Date
rr- 1a25f8c9fb
external_files: parse ~ in --{sub,audio}-paths 2017-05-31 13:10:34 +01:00
nodiscc 969c25d2f7 OSD message: "Drop files or URLs to play here."
Add "or URLs" to the default OSD message when mpv is launched without parameters.
Since this works flawlessly with youtube-dl integration, the fact that you can drop URLs directly to the window should be advertised more.
2017-05-31 12:56:14 +01:00
wm4 c443aa68d3 demux_mkv: vp9 alpha, second try
The parser is used to split superframes, and the decoder didn't like
when the blockadditional was duplicated on the second split packet.
2017-05-30 22:50:05 +02:00
wm4 3a448ab972 demux_mkv: fix alpha with vp9 + libvpx
The blockadditional side data gets lost because vp9 has to go through
the parser.
2017-05-30 19:26:27 +02:00
Raúl Peñacoba bc3365b169 video/out/wayland/buffer.c: Add missing free() 2017-05-26 08:52:12 +01:00
Sebastian Reuße b7d0dfaf1a ipc-unix: don’t truncate the message on EAGAIN
Fixes #4452.
2017-05-24 21:55:22 +02:00
wm4 83a9b0bc48 videotoolbox: support new libavcodec API
The new API has literally no advantages (other than that we can drop
mp_vt_download_image and other things later), but it's sort-of uniform
with the other hwaccels.

"--videotoolbox-format=no" is not supported with the new API, because it
doesn't "fit in". Probably could be added later again.

The iOS code change is untested (no way to test).
2017-05-24 15:25:48 +02:00
wm4 2426f95e0f vd_lavc: check for missing device_ctx ref
It's not really guaranteed that other components always set this (e.g.
on subtle errors), so check it explicitly. Although I'm not aware of a
failing case.
2017-05-24 14:40:25 +02:00
wm4 2a04906063 hwdec: fix 2 comments
The first is outdated, the second was always wrong.
2017-05-24 14:32:23 +02:00
wm4 25a4d10c8e player: make sure version information is always included in --log-file
If --log-file was used in config files, this could be missing due to the
exact timing when the messages are print, and when the options are
applied. Fix this by always dumping the version again when a log file is
opened.
2017-05-22 18:31:39 +02:00
Ricardo Constantino 5974f575a6
man/options: further document --chapters-file accepted files 2017-05-22 16:10:49 +01:00
wm4 e77ed53459 ad_spdif: change license to LGPL
All authors have agreed. (Even the main author, if you wonder about the
entry in the Copyright file.)
2017-05-21 12:35:53 +02:00
wm4 43aaba4f73 ao_pcm: change license to LGPL
All relevant authors have agreed to the relicensing.

Problem cases:

eca47b1a5edae: someone else gets credited for the "idea" of this change,
but it doesn't seem like it was a patch (otherwise reimar would have
said "patch"). Also, the associated code got essentially removed again
anyway. (The option parsing was rewritten fully.)

ffb529e4eb2a9: anonymous/unknown author, but the code was fully removed
anyway. The struct was removed, and the modern code does explicit
read/write calls.

40789473d215b: author was not contacted, but this code was removed
anyway. The magic number (0x7ffff000) is still in the new code, but I
don't think that is copyright relevant.

c750b8ab2d3c8: the message was entirely removed.
2017-05-20 12:46:08 +02:00
Yue Zhu 8a7614a0fb TOOLS/lua/autoload.lua: ignores all files starting with "." 2017-05-20 11:44:11 +02:00
wm4 7840125e22 audio/out: change license of some core files to LGPL
All contributors of the current code have agreed. ao.c requires a
"driver" entry for each audio output - we assume that if someone who
didn't agree to LGPL added a line, it's fine for ao.c to be LGPL
anyway. If the affected audio output is not disabled at compilation
time, the resulting binary will be GPL anyway, and ootherwise the
code is not included.

The audio output code itself was inspired or partially copied from
libao in 7a2eec4b59 (thus why MPlayer's audio code is named libao2).
Just to be sure we got permission from Aaron Holtzman, Jack Moffitt, and
Stan Seibert, who according to libao's SVN history and README are the
initial author. (Something similar was done for libvo, although the
commit relicensing it forgot to mention it.)

242aa6ebd40: anders mostly disagreed with the LGPL relicensing, but we
got permission for this particular commit.

0ef8e555735: nick could not be reached, but the include statement was
removed again anyway.

879e05a7c17: iive agreed to LGPL v3+ only, but this line of code was
removed anyway, so ao_null.c can be LGPL v2.1+.

9dd8f241ac2: patch author could not be reached, but the corresponding
code (old slave mode interface) was completely removed later.
2017-05-20 11:43:57 +02:00
wm4 9b5e4e5715 demux_raw: drop "mp-rawvideo" use
This is an old pseudo codec to pass through the pixel format. Setup a
suitable AVCodecParameter directly instead, so the "rawvideo" codec can
be used.
2017-05-20 11:43:57 +02:00
Akemi 37f0571973 cocoa: properly unhide Dock when quitting during System fs animation
when quitting mpv during the System fullscreen animation cocoa can't
reset some flags properly and won't reset the Dock hiding behaviour
to it's previous state.

Fixes #4400
2017-05-19 19:19:29 +02:00
wm4 7aa070e1cb vdpau: crappy hack to allow initializing hw decoding after preemption
If vo_opengl is used, and vo_opengl already created the vdpau interop
(for whatever reasons), and then preemption happens, and then you try to
enable hw decoding, it failed. The reason was that preemption recovery
is not run at any point before libavcodec accesses the vdpau device.

The actual impact was that with libmpv + opengl-cb use, hardware
decoding was permanently broken after display mode switching (something
that caused the display to get preempted at least with older drivers).
With mpv CLI, you can for example enable hw decoding during playback,
then disable it, VT switch to console, switch back to X, and try to
enable hw decoding again.

This is mostly because libav* does not deal with preemption, and NVIDIA
driver preemption behavior being horrible garbage. In addition to being
misdesigned API, the preemption callback is not called before you try to
access vdpau API, and then only with _some_ accesses.

In summary, the preemption callback was never called, neither before nor
after libavcodec tried to init the decoder. So we have to get
mp_vdpau_handle_preemption() called before libavcodec accesses it. This
in turn will do a dummy API access which usually triggers the preemption
callback immediately (with NVIDIA's drivers).

In addition, we have to update the AVHWDeviceContext's device. In theory
it could change (in practice it usually seems to use handle "0").
Creating a new device would cause chaos, as we don't have a concept of
switching the device context on the fly. So we simply update it
directly. I'm fairly sure this violates the libav* API, but it's the
best we can do.
2017-05-19 15:24:38 +02:00
James Ross-Gowan 3a7b4df4bf ao_wasapi: set name of event thread 2017-05-18 00:11:14 +10:00
James Ross-Gowan bc381dd05e win32: pthread: use the new thread naming API
Windows, as of the Creators Update, finally has a sane API for giving a
name to a thread that can be used by debuggers. This is similar to
pthread_setname_np on Linux and some Unixes. Expose it in the pthread
wrapper and use it for mpthread_set_name().
2017-05-18 00:11:14 +10:00
James Ross-Gowan 6a00059850 context_angle: fix fallback to D3D9 device
This was broken in e0250b9604. In some cases, device creation will
succeed, but creating an EGL context on the device will fail. With
--angle-renderer=auto, it should try to create the context again on a
D3D9 device.

This fixes mpv in Windows Vista on VirtualBox for me.
2017-05-16 22:59:15 +10:00
wm4 858bcea5b4 manpage: document tricky issue with IPC observe_property command
Seems like people get confused by this.
2017-05-16 12:20:39 +02:00
wm4 73a0ea4d87 manpage: better description for --external-file 2017-05-16 12:20:01 +02:00
James Ross-Gowan fe09d76142 w32_common: drop TLS usage
This was added in 3f268cc4f2 because it wasn't clear whether
WM_NCCREATE could be used to send a context pointer from CreateWindowEx
to the window procedure. WM_NCCREATE isn't always the first message sent
to a window, but this seems to be because of an undocumented but
well-known bug where, for top-level overlapped windows, a spurious
WM_GETMINMAXINFO arrives first instead. The WM_GETMINMAXINFO can be
safely ignored, so it is still okay to pass the context struct in
WM_NCCREATE.
2017-05-16 20:13:09 +10:00
wm4 6fe75c38d8 demux_mkv: read headers at the end of the file sorted by position
Try to read header elements stored at the end of the file in the order
of their position. (It would be nicer if mkv simply told us a range of
elements to parse, but it doesn't do that.)

This can potentially reduce seek elements, although I didn't check if
any real files trigger this. The real contribution by this change is
that it does not defer reading the CUE index if we need to seek to the
end of the file anyway. This can actually avoid 2 seeks when opening a
file and --start is used, and the file has other headers elements at the
end of the file (like tags).
2017-05-15 16:40:57 +02:00
wm4 5f2c4d4799 cache: move duplicated condition to a function
While subtly duplicating such checks happens a lot in this file, this
particular case can be easily factored into a function.
2017-05-15 16:02:48 +02:00
Uoti Urpala 3f17b101ee cache: fix unnecessary seek blocking from f4d62dc4a0
Commit 374600cec0 ("cache: propagate seek failures") changed
stream-level seeks to be done in the calling thread so possible errors
could be reported. This commit included some rationale why doing the
stream-level seeks synchronously was not a big issue. However, the
following fixup commit f4d62dc4a0 changed the seek code to always
synchronize with the cache thread and do seek handling there. This is
a problem because it affects even seeks within already cached data
(which require no stream-level seek). With a network server that sends
data in bursts, the cache thread can be blocked in a read call for a
long time; the added synchronization means that seeking within already
downloaded data can have unnecessary long delays.

Change cache_seek() to check whether the seek is expected to result in
a stream-level seek, and skip synchronization if it is not. This means
that seeks within the cached portion of the file now again happen
immediately without possibly waiting for network.

Signed-off-by: wm4 <wm4@nowhere>
2017-05-15 15:47:20 +02:00
Niklas Haas 5aea98551b csputils: code clarity
`cmax` is more intuitive than `cmin` especially for full-range YUV, and
this also explains the behavior of `anyfull` better.
2017-05-13 17:25:24 +02:00
James Ross-Gowan e6a6677630 w32_common: use the proper keycodes for XBUTTON1/2
mpv's mouse button numbering is based on X11, which means XBUTTON1 and 2
on Windows (the "back" and "forward" buttons) should map to MOUSE_BTN7
and 8 in mpv. MOUSE_BTN5 and 6 refer to the horizontal scroll buttons on
mouses that have them.
2017-05-12 22:58:58 +10:00
James Ross-Gowan 18a45a42d5 w32_common: generate MP_AXIS_* keycodes for scrolling
Windows doesn't have a way to distinguish "precise" mouse wheel events
and events from regular notched mouse wheels. A notched wheel should
always send events with a delta of 120, but a precise wheel could also
happen to send 120 if multiple scroll events are coalesced (and to make
things even harder, some buggy Microsoft drivers send deltas less than
120, even for notched wheels.) Since there is no distinction, but
MP_AXIS_* keycodes can hold more information (the delta value,) send
MP_AXIS_* events for both kinds of mouse wheel scrolling.
2017-05-12 22:58:58 +10:00
James Ross-Gowan 89fd3e1d9d command: use scale_units to add/cycle integer properties
This adds check_property_scalable, which returns true if the property is
backed by a floating-point number. When the add or cycle commands
operate on these properties, they can benefit from the fractional scale
value in cmd->scale. When the property is not backed by a floating-point
number, cmd->scale_units is used instead, so for axis events, the
property is only incrmented when the user scrolls one full unit.

This solution isn't perfect, because in some cases integer-backed
properties could benefit from accurate scrolling. For example, if an
axis is bound to "cycle audio 5", the cycle command could be made to
change the audio track by one when the user scrolls 1/5th of a unit,
though this behaviour would require more changes to the options system.
2017-05-12 22:58:58 +10:00
James Ross-Gowan 937128697f input: pre-process MP_AXIS_* input
This adds some logic for pre-processing MP_AXIS_* events before the
corresponding input command is generated.

Firstly, the events are filtered. A lot of touchpad drivers and
operating systems don't seem to filter axis events, which makes it
difficult to use the verical axis (MP_AXIS_UP/MP_AXIS_DOWN) without
accidentally triggering commands bound to the horizontal axis
(MP_AXIS_LEFT/MP_AXIS_RIGHT) and vice-versa. To fix this, a small
deadzone is used. When one axis breaks out of the deadzone, events on
the other axis are ignored until the user stops scrolling (determined by
a timer.)

Secondly, the scale_units value is determined, which is the integer
number of "units" the user has scrolled, as opposed to scale, which is
the fractional number of units. It's determed by accumulating the
fractional scale values. If an axis is bound to a "non-scalable" command
that doesn't understand fractional units, interpret_key() will queue
that many commands, each with scale = 1.0.
2017-05-12 22:58:58 +10:00
James Ross-Gowan 6ccb7b5fa5 command: mark some commands as "scalable"
Scalable commands (seek, cycle and add) understand the cmd->scale
parameter and will "scale" their action accordingly, for example, a seek
with scale = 0.5 will only seek half the specified amount and a seek
with scale = 2.0 will seek twice as much.

Mark these commands so in the next commit, input.c will be able to
synthesize input with cmd->scale = 1 for non-scalable commands.
2017-05-12 22:58:58 +10:00
James Ross-Gowan cc6922cf06 input: add MP_KEY_IS_AXIS and treat MP_AXIS_* as mouse events
MP_AXIS_* events are semantically equivalent to scroll button events
(eg. MP_MOUSE_BTN{3,4,5,6}). They depend on the mouse position.
2017-05-12 22:58:58 +10:00
wm4 2b616c0682 vo_opengl: drop TLS usage
TLS is a headache. We should avoid it if we can.

The involved mechanism is unfortunately entangled with the unfortunate
libmpv API for returning pointers to host API objects. This has to be
kept until we change the API somehow.

Practically untested out of pure laziness. I'm sure I'll get a bunch of
reports if it's broken.
2017-05-11 17:47:33 +02:00
wm4 f2961425e7 cache: clarify that copyright will be changed to LGPL v2.1 if possible
Clearly the licensing situation isn't confusing enough.

I don't know why that guy insists on LGPLv3.
2017-05-11 17:11:01 +02:00
wm4 c0ba8b520f vf.c, vf.h: change license to LGPL
Most authors have agreed. Like with vo.c, we don't take module
declarations into consideration (see 0e09533c73).

Notable issues:

115bfb9762: the author has (probably) not agreed. The vf.c changes were
removed with the removal of filter DR, though (see c54fc507da).

7b25afd742: the same author adds VOCTRLs for deinterlacing switching at
runtime. Put them under a HAVE_GPL ifdef just to be sure. (It looks like
we could remove the VOCTRLs immediately, as they're needed only for some
compatibility things, but no need to do that yet.)

02b199e5e9: the author had a conditional agreement to LGPL, which
doesn't allow us to change it just yet, but the code added here was
completely removed anyway. (These days, the pts is passed as mp_image
field, and put_image is gone.)

3532cd532e: same author, but code removed with DR removal.

f0626e2f8d: same author, but code was moved to mp_image.c.

e5b4b495c3: agreed to LGPLv3+ only, but the code was removed in
cfa1f9e082 anyway.

086c324692: author was not asked - minor warning fix, but no mpv
includes malloc.h anymore.

e9d0a1d609: author was not asked - removed again in 33b62af947.

c260a1139d: author could not be reached - but this code was removed when
mpv changed the image allocation code to essentially use FFmpeg's
pixdesc.
2017-05-11 15:02:58 +02:00
wm4 faefbbaaa5 af_format: change license to LGPL
This case is a bit weird, because MPlayer certainly also has a file
named af_format.c. Both appear to have the function of converting audio
data between sample formats.

However, mpv's af_format.c is a rewrite, and doesn't actually do
conversion by itself. It's similar to vf_format.c, and forces the
generic filter chain code to insert conversion filters, instead of doing
conversion explicitly.

mpv's current af_format.c started out as af_force.c in d9582ad0a4. It
was renamed to af_format.c in e60b8f181d, while the old af_format.c was
split into two new filters. In 943c785619 the filename was changed to
af_format.c as well.

The new af_format.c does not contain any libaf code, except for some
potentially copy & pasted skeleton and boilerplate code. (We don't
account for this in per-filter file licenses, as the old libaf code
has to be removed fully, at which point the filters will have to be
ported to another framework, which will removed that boilerplate code.)

The old filters based on af_format.c were progressively replaced and
removed. Support for non-native endian and formats with signedness
different from native FFmpeg was completely removed in 831d7c3c40.
The old 24 bit conversion code was removed in 552dc0d564 (made
unnecessary by 5a9f817bfd).

Also list hwdec_vaglx.c as GPL-only, which doesn't have anything to do
with this commit.
2017-05-11 11:25:45 +02:00
wm4 99cef59fc9 dvb: disable by default
It fails building with some older kernel headers, and the current test
does not auto-disable it in these cases.

Since DVB isn't going to be used by many people, I think disabling it by
default is reasonable.
2017-05-11 08:19:02 +02:00
wm4 f38bd0f25a stream_smb: disable by default, mark as GPLv3
It seems libsmbclient has been GPLv3 for years. Also, it's certainly not
LGPL (unlike some of its support libs like talloc). Thus, mpv built with
Samba support is GPLv3.

Disable it by default, so we don't have to go through the trouble to
indicate the correct license in our output, and we don't trick people
into distributing stuff under the wrong license.
2017-05-11 08:19:02 +02:00
wm4 aac871deb4 stream_file: change license to LGPL
This has a messy history all back to the initial commit with multiple
refactors, but it seems almost all authors agreed.

Exceptions:

2aa6acd9747: patch by someone who could not be reached. Whether or not
this code is still in mpv is unknown, but the affected code was moved to
stream.c at one point anyway.

3859bbd9fef: not sure if this is a patch by the mentioned person (I
assume not) or the committer (who agreed to LGPL), but it seems the
change is too trivial to affect copyright. It seems even the FD check
can be dropped, which I'm doing in this commit.

58846451f0e: author doesn't reply. But reverting this and letting
someone who has never seen this commit before redo it would lead to
exactly the same code. So I'm claiming that the change is not
copyrightable.
2017-05-11 08:14:48 +02:00
wm4 a28cf44ebc cookies: change license to LGPL
All authors have agreed.

One minor exception is 21a9221e7b (patch by someone who wasn't asked),
but we just remove the added line again. It seems unneeded.
2017-05-11 07:29:01 +02:00
wm4 0e09533c73 vo.c, vo.h, vo_null.c: change license to LGPL
Most contributors have agreed. vo.c requires a "driver" entry for each
video output - we assume that if someone who didn't agree to LGPL added
a line, it's fine for vo.c to be LGPL anyway. If the affected video
output is not disabled at compilation time, the resulting binary will be
GPL anyway.

One problem are the changes by Nick Kurshev (usually using "nick" as SVN
username). He could not be reached. I believe all changes to his files
are actually gone, but here is a detailed listing:

fa1d5742bc: nick introduces a new VO API. It was removed in 64bedd9683.
Some of this was replaced by VOCTRLs are introduced in 7c51652a1b,
obviously replacing at least some functionality by his API.

b587a3d642: nick adds a vo_tune_info_t struct. Removed in 64bedd9683
too.

9caad2c29a: nick adds some VOCTRLs, which were silently removed in
8cc5ba5ab8 (they became unused probably with the VIDIX removal).

340183b0e9: nick adds VO-based screenshots, which got removed in
2f4b840f62. Strangely the same name was introduced in 01cf896a2f again,
but this is a coincidence and worked differently (also it was removed
yet again in 2858232220).

104c125e6d: nick adds an option for "direct rendering". It was renamed
in 6403904ae9 and fully removed in e48b21dd87.

5ddd8e92a1: nick adds code to check the VO driver preinit arg to every
single VO driver. The argument itself and any possibly remaining code
associated with it was removed in 1f5ffe7d30.

f6878753fb: nick adds header inclusion guards. We assume this is not
relevant for copyright.

Some of nick's code was merely moved to other files, such as the
equalizer stuff added in 555c676683 and moved in 4db72f6a80 and
12579136ff, and don't affect copyright of these files anymore.

Other notes:

fef7b17c34: a patch by someone who wasn't asked for relicensing added a
symbol that was removed again in 1b09f4633.

4a8a46fafd: author probably didn't agree to LGPL, but the function
signature was changed later on anyway, and nothing of this is left.

7b25afd742: the same author adds a symbol to what is vo.h today, which
this relicensing commit removes, as it was unused. (It's not clear
whether the mere symbol is copyrightable, but no need to take a risk.)

3a406e94d7, 9dd8f241ac: slave mode things by someone who couldn't be
reached. This aspect of the old slave mode was completely removed.

bbeb54d80a: patch by someone who was not asked, but the added code was
completely removed again.
2017-05-10 15:06:20 +02:00
wm4 6aba929a1b demux/stheader: change license to LGPL
All authors of the current code have agreed.

For most of its life, MPlayer used Microsoft structs like WAVEFORMATEX
to describe media content. It appears these were copied from wine in
61c5a99851. Copyright is unclear, but mpv completely removed use of
these structs anyway. (demux_mkv.c still contains code to read these
fields from a byte stream, but the struct is fully gone.)

42f97b2b820: cehoyos (who probably didn't agree with LGPL) applied a
patch by someone who agreed. It's unknown whether cehoyos modified the
patch (and thus his copyright would apply), but the changed code was
removed anyway. (The code was first moved somewhere else, then removed.)

efd53eed614: the patch author was not asked. Although the mkv_sh_sub_t
struct was later moved to stheader.h, the added field was removed
without replacement.

f6878753fbd: nick, who could not be reached, added an include guard, but
the guard was changed several times later, and it's probably not
copyrightable anyway.

afb0fd5ea17: the same nick adds a field that was later replaced and
finally removed again in 8cd6b20571.
2017-05-10 13:18:08 +02:00
wm4 bda25e17b6 af_scaletempo: change license to LGPL
All authors have agreed.

The initial commit d33703496c as well as the current code contain this
line:

  * inspired by SoundTouch library by Olli Parviainen

We assume this is about the algorithm (not the code), and the author of
the original patch actually wrote all code himself.
2017-05-09 12:53:37 +02:00
wm4 5eec3d08d5 af_lavcac3enc: change license to LGPL
All authors have agreed.

As usual with these things, this probably does not include residues from
the libaf framework.
2017-05-09 12:46:40 +02:00
wm4 04df16bfd3 ao_pulse, ao_rsound: change license to LGPL
All authors have agreed.

One exception is 71247a97b3, whose author was not asked, but we deem
the change as trivial. (And technically it was replaced when the audio
chain dropped non-native endian sample formats.)
2017-05-08 14:09:49 +02:00
wm4 c87224bf1b ao_coreaudio: change license to LGPL
All authors have agreed to the relicensing.

The code was pretty much rewritten by Stefano Pigozzi. Since the rewrite
happened incrementally, and seems to include refactored portions of
older code, this relicensing was done on the pre-refactor code do.

The original commit adding this AO (as ao_macosx.c) credits Timothy J.
Wood as original author. He was asked and agreed to LGPL. It's not
entirely sure from which project this code came from, but it's probably
libao. In that project, Stanley Seibert made some changes to it (who as
a major developer of libao was asked just to be sure), and also Ralph
Giles and Ben Hines made two small changes. The latter were not asked,
but none of their code survived anyway.
2017-05-08 13:57:40 +02:00
wm4 6dd0d869a2 osdep/endian.h: change license to LGPL
Or maybe it would be better to write "confirm" than "change".

The MP_SELECT_LE_BE macro definition has some similarity with some old
MPlayer definition, but it's different code with a different idea, so I
don't think it's affected by that.

The BYTE_ORDER etc. macro definitions are similar to those found in
various system headers (this code emulates the ones often found in
<sys/types.h>), but I don't think there is a copyright problem either.
2017-05-08 13:19:28 +02:00
wm4 c64d40bad7 osdep/compiler.h: change license to LGPL
This didn't have a header and this was implied LGPL, but this was not
entirely correct. It turns out the printf attribute code was leaked in
from talloc, which is "LGPL v3 or later". talloc was added to the
mplayer2 code base in 27a30e310e. This remaining code was an oversight.

Since we want to reduce LGPL v3 code, replace this code with the one
from ta/ta.h. This code was explicitly written newly to get rid of
talloc and its license in 0933f12d28.
2017-05-08 13:11:46 +02:00