Commit Graph
39985 Commits
Author SHA1 Message Date
wm4 d8152b7003 wayland: implement key modifiers
Includes shift, ctrl, alt, meta.
2015-01-25 17:00:19 +09:00
wm4 6a9cdfa771 wayland: don't compute absurd window size
For some reason, schedule_resize() can be called with everything set to
0. The code couldn't handle wl->window.aspect set to 0, converting NaNs
to integers. Just work this around.

(I have no idea what I'm doing. This is probably a corner case caused
by my broken-ish wayland setup.)
2015-01-25 17:00:19 +09:00
wm4 399e746275 manpage: improve --title description
It might be rather surprising that --title also sets the audio stream
title (for PulseAudio and wasapi), so it certainly should be mentioned.
2015-01-25 17:00:19 +09:00
wm4 929c4a5529 client API: reasonable behavior if window is closed
Closing the video window sends CLOSE_WIN, which is normally mapped to
the "quit" command. The client API normally disables all key bindings,
and closing the window does nothing. It's simply left to the application
to handle this. This is fine - an embedded window can not be destroyed
by user interaction.

But sometimes, the window might be destroyed anyway, for example because
the containing window is destroyed. If this happens, CLOSE_WIN should
better not be ignored. We can't expect client API users to handle this
specially (by providing their own input.conf), so provide some fallback
for this pseudo key binding. The "quit" command might be too intrusive
(not every client necessarily handles "unexpected" MPV_EVENT_SHUTDOWN),
but I think it's still reasonable.
2015-01-25 17:00:19 +09:00
wm4 38903486fb player: enable demuxer thread for external audio files
Enable asynchronous reading for external files. This excludes subtitle
files (so it's effectively enabled for audio files only), because most
subtitle files are fully read on loading, and running a thread for them
would just cause slowdowns and increase resource usage, without having
any advantages.

In theory, an external file could provide multiple tracks from the same
demuxer, but demux_start_thread() is idempotent, so the code can be
kept simple.

Should help with playing DASH with ytdl_hook.
2015-01-25 17:00:19 +09:00
wm4 c56b237b3c ao_alsa: fix dtshd passthrough
We must not try to remap channels with this. Whethever ALSA gives us,
and whatever we do with it, the result will probably be nonsense.

Untested, as I don't have the required hardware.
2015-01-25 17:00:19 +09:00
wm4 63e401ccc9 tl_matroska: check chapter bounds
I have no idea what this does, but it's without doubt a sufficient fix
for the issue at hand.

Fixes #1445.

Conflicts:
	player/timeline/tl_matroska.c
2015-01-25 17:00:18 +09:00
wm4 35cc1830a3 ao_pulse: disable latency calculation hacks by default
This used to be required to workaround PulseAudio bugs. Even later, when
the bugs were (partially?) fixed in PulseAudio, I had the feeling the
hacks gave better behavior. On the other hand, I couldn't actually
reproduce any bad behavior without the hacks lately. On top of this, it
seems our hacks sometimes perform much worse than PulseAudio's native
implementation (see #1430).

So disable the hacks by default, but still leave the code and the option
in case it still helps somewhere. Also, being able to blame PulseAudio's
code by using its native API is much easier than trying to debug our own
(mplayer2-derived) hacks.
2015-01-25 17:00:18 +09:00
wm4 f4a9c9424f win32: request UTF-16 API variants, Vista+ APIs, and COM C macros
Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into
the build system, instead of defining them over and over in the code.

Conflicts:
	video/out/w32_common.c
	waftools/checks/custom.py
2015-01-25 17:00:18 +09:00
wm4 d9da0c9ce9 terminal: always print to stderr with --no-input-terminal
The function terminal_in_background() reports whether the player was
backgrounded. In this case, we don't want to annoy the user by still
printing the status to stderr. If no terminal interaction is assumed,
this mechanism is disabled, and stderr is always used. The read_terminal
variable signals this case.

Oddly, just redirecting stderr will disable output to stderr, because
the background check with tcgetpgrp() is done on stderr, but
read_terminal is still true (because that one depends on stdin and
stdout).

Explicitly disable this mechanism if --no-input-terminal is used by
setting read_terminal to true only if terminal input is actually
initialized.
2015-01-25 17:00:18 +09:00
Philip Sequeira 5f3f36a800 TOOLS/zsh.pl: complete options based on types
No more equals signs for options that don't take values.

Complete values for options with preset choices.

Complete --no-whatever where applicable.

Fixes #997.
2015-01-25 17:00:18 +09:00
wm4 12c316d95e player: use libavutil API to get number of CPUs
Our own code was introduced when FFmpeg didn't provide this API (or
maybe didn't even have a way to determine the CPU count). But now,
av_cpu_count() is available for all FFmpeg/Libav versions we support,
and there's no reason to have our own code.

libavutil's code seems to be slightly more sophisticated than our's, and
it's possible that the detected CPU count is different on some platforms
after this change.
2015-01-25 17:00:18 +09:00
wm4 cf997ff691 player: print used number of threads in verbose mode
Also, don't use av_log() for mpv output.
2015-01-25 17:00:18 +09:00
wm4 1560f74dde demux_mkv: avoid PTS warning with image attachments
Removes an annoying "No video PTS! Making something up." warning.

Mark it as keyframe, which is needed to prevent strange behavior with
PNG. Also, don't leak the picture data.
2015-01-25 17:00:18 +09:00
wm4 9b9d453748 manpage: clarify syntax for color options
Options which take colors accept two variants. The first is "r/g/b/a",
the second is "#AARRGGBB". Since they put alpha at different places,
it's probably better to document the second variant explicitly. (It's a
bit strange that they put alpha in different places, but on the other
hand, it's kind of natural. The second variant should probably be
considered deprecated.)
2015-01-25 17:00:18 +09:00
wm4 cb9b59858d TOOLS/lua/observe-all: add a warning
This is just natural, but it's also not that obvious.
2015-01-25 17:00:18 +09:00
wm4 3f85092ffe TOOLS/lua/autoload: fix behavior with network URLs
readdir() fails if the directory is an URL, so just exit instead of
letting the Lua script fail.
2015-01-25 17:00:18 +09:00
wm4 f4634e404f vf_vapoursynth: fix Lua backend
It couldn't handle the newly added float variable.
2015-01-25 17:00:18 +09:00
wm4 dbc00297cc vf_vapoursynth: pass through container FPS value
This is basically a hack; but apparently a needed one, since many
vapoursynth filters insist on having a FPS set.

We need to apply the FPS override before creating the filters. Also
change some terminal output related to the FPS value.
2015-01-25 17:00:18 +09:00
wm4 1e14d65db8 manpage: vf_vapoursynth: document mpv-specific predefined variables 2015-01-25 17:00:17 +09:00
wm4 57829ed95a x11: make display-names property observable
Reuse MP_EVENT_WIN_STATE for this.
2015-01-25 17:00:17 +09:00
wm4 2f69e8f93c video: better pipelining with vf_vapoursynth
Most of this is explained in the code comments. This change should
improve performance with vapoursynth, especially if concurrent requests
are used.

This should change nothing if vf_vapoursynth is not in the filter chain,
since non-threaded filters obviously can not asynchronously finish
filtering of frames.
2015-01-25 17:00:17 +09:00
wm4 6b063b3767 TOOLS/stats-conv: more improvements
Add an explicit "signal" event type, because the implicit one was
confusing.

Don't rescale the Y axis of the second graph, it was nonsense.

Make the legend for the second graph separate (and cleanup the code
creating the graphs).
2015-01-25 17:00:17 +09:00
Kevin Mitchell a5191c1479 ao/wasapi: style/code formatting tweaks 2015-01-25 17:00:17 +09:00
Kevin Mitchell cfc5a65494 ao/wasapi: use IsEqualGUID and IsEqualPropertyKey
before we were reinventing this wheel
2015-01-25 17:00:17 +09:00
Kevin Mitchell 307b8925ee ao/wasapi: set the ao with the waveformat channelmap
hopefully this fixes #1350
2015-01-25 17:00:17 +09:00
Kevin Mitchell 2090a35c57 ao/wasapi: improve exclusive mode format search
fixes #1376
2015-01-25 17:00:17 +09:00
Kevin Mitchell 2746910515 ao/wasapi: revamp set_waveformatex
* bits instead of bytes
* add valid_bits argument
* just pass in the mp_chmap and get the number and wavext channel map from that
* indicate valid bits in waveformat_to_str
* make appropriate accomodations in try_format
2015-01-25 17:00:17 +09:00
Kevin Mitchell 40dce4048f ao/wasapi: add CO_E_NOTINITIALIZED to explain_err
someone on irc reported seeing this error
2015-01-25 17:00:17 +09:00
ChrisK2 465bd38dc6 OSC: idlemessage: fix alignment 2015-01-25 17:00:17 +09:00
wm4 5992ff785c TOOLS/stas-conv: add timed value event type 2015-01-25 17:00:17 +09:00
wm4 b6d8694062 TOOLS/stats-conv: better output
Sort the legend by the used y value of binary events/signals, add a way
to filter branches (although that requires editing the script), and use
the full screen if the second subplot is not used.
2015-01-25 17:00:17 +09:00
ChrisK2 7b8ab2005e OSC: display "drop files here" message when idle + forced-window
This currently doesn't work properly on OSX due to some bugs.
2015-01-25 17:00:16 +09:00
wm4 4912fef753 build: rename MPLAYER_CONFDIR define
We certainly don't use the mplayer configuration dir. The name didn't
matter, but now that it's in user-visible output (as part of config.h
being dumped in verbose mode), it's a bit too strange.
2015-01-25 17:00:16 +09:00
wm4 c9c9919b2d player: print config.h contents in verbose mode
It was requested that mpv should print what features etc. have been
enabled at compile time. It can print the configure command line, but it
obviously doesn't include autodetected features.

I tried to think of a nicer way than dumping the config.h as text, but
this was still the simplest way.

Conflicts:
	player/main.c
2015-01-25 17:00:16 +09:00
wm4 b1c76e6a59 build: prefer libswresample over libavresample on FFmpeg
I hoped we could always use libavresample, but the FFmpeg project is
being too dickish to enable libavresample by default - which means we
need our libswresample-to-libavresample hack anyway.

Give up, and use the "supported" one of the duplicated libraries when
compiling against FFmpeg (relying on the fact that libswresample won't
be present if compiling against Libav).
2015-01-25 17:00:16 +09:00
wm4 58c91c02e2 DOCS/client_api_examples: don't throw char* in C++ code
C++ is the worst language ever, and allows throwing any type, even if it
doesn't make sense. In this case, we were throwing char*, which the
runtime typically treats as opaque, instead of printing it as message if
such an exception was not caught.

Conflicts:
	DOCS/client_api_examples/qml/mpvrenderer.cpp
2015-01-25 17:00:16 +09:00
wm4 5c1c8b5fab command: make the "run" command work on Windows too
Do so by using mp_subprocess(). Although this uses completely different
code on Unix too, you shouldn't notice a difference. A less ncie thing
is that this reserves an entire thread while the command is running
(which wastes some memory for stack, at least). But this is probably
still the simplest way, and the fork() trick is apparently not
implementable with posix_subprocess().

Conflicts:
	player/command.c
2015-01-25 17:00:16 +09:00
wm4 85f54ce5d0 subprocess: allow disabling redirection of stdout/stderr
If the stdout or stderr write callback is NULL, then don't redirect this
stream. Preparation for the next commit.

Not sure what to do on Windows; it seems STARTUPINFO doesn't allow
redirection only one of them. So just let them write nothing. For our
intended use-case (next commit), this is probably sensible.
2015-01-25 17:00:16 +09:00
wm4 c473688c5f gl_hwdec_vda: refuse to work with old OpenGL versions
The way we use rectangle textures (required by VDA for no reason) works
onl in OpenGL 3.0 or higher. Below that, the shader will fail to
compile. We could add support for older OpenGL versions, but that would
be a major pain.

This normally doesn't matter; mpv itself always creates OpenGL 3.2
contexts on OSX. But it could matter if a client API user uses
vo_opengl_cb, and gives it a 2.1 context (which OSX also allows you to
create).

Conflicts:
	video/out/gl_hwdec_vda.c
2015-01-25 17:00:16 +09:00
wm4 413bd22527 DOCS/client_api_examples: add an explicit license
IANAL, but we don't give a shit what you do with this code.
2015-01-25 17:00:16 +09:00
wm4 ccf8c42a42 ao_alsa: print channel map if setting it fails
This message is printed when the audio device advertised a channel map,
but couldn't set it - which is probably a dmix bug (we'll never know,
ALSA doesn't take bug reports).

Print the requested map, so that the user (maybe) can make a connection
when seeing the message and the actually used channel map, which might
be less confusing. Or at least less useless.
2015-01-25 17:00:16 +09:00
Stefano Pigozzi 4759f61e73 build: fix linking with --enable-static-build 2015-01-25 17:00:16 +09:00
Stefano Pigozzi 1a346ce11b ao: add debug log with the detected channel maps
This could be helpful with bug reports.
2015-01-25 17:00:16 +09:00
Stefano Pigozzi 891a9727c6 chmap_sel: add multichannel fallback heuristic
Instead of just failing during channel map selection, try to select a close
layout that makes most sense and upmix/downmix to that instead of failing AO
initialization. The heuristic is rather simple, and uses the following steps:

1) If mono is required always prefer stereo to a multichannel upmix.
2) Search for an upmix that is an exact superset of the required channel map.
3) Search for a downmix that is the exact subset of the required channel map.
4) Search for either an upmix or downmix that is the closest (minimum difference
   of channels) to the required channel map.
2015-01-25 17:00:15 +09:00
Stefano Pigozzi 2e133e9dde chmap: add a 7.1(rear) layout name
This is common on Apple systems so it's handy to have a label for it.
2015-01-25 17:00:15 +09:00
James Ross-Gowan f5c19f29af w32_common: allow window resizing with --no-border
Conflicts:
	video/out/w32_common.c
2015-01-25 17:00:15 +09:00
Niklas Haas ca048e8d6d vo_opengl: Ignore approx-gamma for BT.2020-CL
The details of the non-linear transformation from/to BT.2020's constant
luminance system don't really make sense with any other gamma curve,
since changing the gamma curve completely breaks the chroma channels.
2015-01-25 17:00:15 +09:00
wm4 a2f4391ca1 stream_pvr: sort channel list by --tv-channels order
Apparently this is what users would expect.

Going the way of least resistance (in terms of messing with this old,
rarely used code), sorting them by some kind of addition timestamp
(called priority in the patch) is the easiest.

Fixes #1390.

Conflicts:
	stream/stream_pvr.c
2015-01-25 17:00:15 +09:00
Stefano Pigozzi 4971ad9e17 cocoa: move the gl function loader to gl_cocoa.c 2015-01-25 17:00:15 +09:00