Commit Graph

39781 Commits

Author SHA1 Message Date
wm4 aca6ec1394 manpage: lua: fix example
Oops.
2014-11-29 20:27:47 +01:00
Sergey Kvachonok 01717dcd2c vo_wayland: Add "multimedia" keyboard key bindings.
libxkbcommon keysyms are the same as X11 keysyms (sans prefix),
so I simply copied the missing subsection from x11_common.c.

Signed-off-by: Sergey Kvachonok <ravenexp@gmail.com>
Signed-off-by: wm4 <wm4@nowhere>
2014-11-29 19:13:47 +01:00
wm4 01a3e43ca9 manpage: minor fixes
Also update the Lua example. The "pause" event was declared deprecated,
so the example should use the newer API.
2014-11-29 19:11:07 +01:00
wm4 a399339b95 player: don't ignore relative seeks by 0 seconds
I don't know why this done; most likely it had no real reason.

Remove it because it breaks "refresh seeks" to the same position.
(Although the refresh seeks mpv sometimes does were fine.)
2014-11-29 01:03:37 +01:00
wm4 87f5ba6ab3 command: avoid returning invalid FPS values
It's possible that fps is sometimes 0 in case it's unset.
2014-11-29 00:37:34 +01:00
wm4 a937ba203d player: reset frame step counter on seeks
I suppose this wasn't done in order to keep the frame step counter
active even in the next file, but actually it was reset anyway.
2014-11-29 00:27:17 +01:00
wm4 9e10f8ccbb vo_opengl: enable fancy-downscaling by default for opengl-hq 2014-11-29 00:04:01 +01:00
wm4 4ce7a2ede9 vo_opengl: disable fancy-downscaling for anamorphic video
Includes some arbitrary minor refactoring.
2014-11-29 00:04:00 +01:00
wm4 3295caca3d lua: add a function that formats Lua values as strings
Yep, Lua is so crappy that the stdlib doesn't provide anything like
this.

Repurposes the undocumented mp.format_table() function and moves it to
mp.utils.
2014-11-29 00:03:46 +01:00
wm4 9666d48aa3 TOOLS/lua: add script that pauses playback when minimizing the window
Uses functionality that was added a month ago for exactly this purpose.

Fixes #1237.
2014-11-29 00:03:46 +01:00
wm4 a72a4b28a0 build: don't install some files if only libmpv is built
encoding-profiles.conf can be used by libmpv, but it won't load it
from this path by default, so exclude it as well.

Fixes #1293.
2014-11-29 00:03:42 +01:00
wm4 4af24daf2c win32: add screen offset when handling overlarge windows
MS Windows doesn't allow windows larger than the screen, so we include
a hack to make the window smaller. This hack recenters the window (what
else would it do?).

It didn't account for the virtual offset of the current screen, and it
was reported that it forces the window to the first screen.

Should fix #1292.
2014-11-28 22:11:54 +01:00
wm4 70630fb803 player: simplify and fix ordered chapter EOF handling
Ordered chapter EOF was handled as special-case of ending the last
segment. This broke --kee-open, because it set AT_END_OF_FILE in an
"inconvenient" place (after checking for --keep-open, and before the
code that exits playback if EOF is reached).

We don't actually need to handle the last segment specially. Instead, we
remain in the same segment if it ends. The normal playback logic will
recognize EOF, because the end of the segment "cuts off" the file.

Now timeline_set_from_time() never "fails", and we can remove the old
segment EOF handling code in mp_seek().
2014-11-28 22:07:46 +01:00
wm4 9a3333e765 demux_mkv: remove ancient codec mapping leftovers
All of this is basically due to how MPlayer's codecs.conf worked. It
had a demuxer-interface based an AVI, using FourCCs and data structures
found in AVI. FourCCs were used to map streams to decoders. For codecs
not supported by AVI, "MPlayer internal" FourCCs were made up.

codec_tags.c is there to bridge demuxers written against the old API to
the mpv one. By now, only demux_mkv.c needs this (because demux_mkv is
the only serious demuxer left - preferably, we should use libavformat
for mkv too, but I can't see this happening any time soon, because
libavformat _still_ doesn't support segment linking). But the codec
tables are full of weird stuff automatically extracted from the old
codecs.conf tables. Most of it isn't needed for mkv.

Remove all custom tags, readd those used by demux_mkv.c internally
(see vinfo and mkv_audio_tag tables). The rest is handled by the
tables provided by libavformat, which includes AVI and QT tags.
2014-11-28 20:54:51 +01:00
Kevin Mitchell 77f675a151 ao/wasapi: handle VistaBlob failure more gracefully 2014-11-28 10:52:48 -08:00
Kevin Mitchell b83e447e2b ao/wasapi: remove unnecessary check of audio thread input
it would have caused a deadlock if it fired anyway.
2014-11-28 10:52:48 -08:00
Kevin Mitchell b0854bc42c ao/wasapi: more consistent/reliable method of computing extra WAVEFORMATEXTENSIBLE size 2014-11-28 10:52:48 -08:00
Kevin Mitchell 8908b80b77 ao/wasapi: more missed cleanup on failure 2014-11-28 10:52:43 -08:00
Kevin Mitchell 7b5baf3b53 ao/wasapi: check return values
Only issue a warning for failure of wasapi_enumerate_devices and
wasapi_fill_VistaBlob.
2014-11-28 10:52:12 -08:00
Kevin Mitchell 14f9719a65 ao/wasapi: make functions return bool that were acting like it
this involved inverting the logic of find_formats, enumerate_devies
and wasapi_fill_VistaBlob. The latter two were trivial as their return
values were not actually checked (to be fixed in a later
commit).
2014-11-28 10:48:36 -08:00
Kevin Mitchell 4f208e6f68 ao/wasapi: check full GUID of KSDATAFORMAT to determine float 2014-11-28 10:48:36 -08:00
Kevin Mitchell 239c880fe2 ao/wasapi: expose GUID and PKEY convenience functions
Give them the prefix mp_ and make them nonstatic.
2014-11-28 10:48:36 -08:00
Kevin Mitchell e2bc1c5f17 ao/wasapi: remove unused variable 2014-11-28 10:48:36 -08:00
Kevin Mitchell fb5d88a287 ao/wasapi: safely define PKEY constants
Before these definitions were incorrectly guarded by and #ifdef
but since they aren't macros, this would never be true so that
if they were ever added to mingw headers we would have problems.

rename KSDATAFORMAT constants with the same mp prefix for consistency.
also use DEFINE_GUID rather than defining the bare structure
2014-11-28 10:48:36 -08:00
Kevin Mitchell 81464780e9 ao/wasapi: avoid redundant passing of ao and wasapi_state as arguments
also drop some useless const declaraitons
2014-11-28 10:48:36 -08:00
Kevin Mitchell 3b0b89c0af ao/wasapi: just return 0 unconditionally from the thread
We weren't actually checking this value anyway. We only really
cared about init failure, which was checked another way.
2014-11-28 10:48:36 -08:00
Kevin Mitchell d40c0d4f90 ao/wasapi: fix unmatched CoUninitialize() on init failure 2014-11-28 10:48:36 -08:00
Kevin Mitchell d0c37f0731 ao/wasapi: more debugging messages 2014-11-28 10:48:07 -08:00
Kevin Mitchell ecb491fd95 ao/wasapi: simplify the init retry 2014-11-28 08:02:16 -08:00
Kevin Mitchell e4aaaf69df ao/wasapi: make get_device_delay return an error code 2014-11-28 08:02:16 -08:00
Stefano Pigozzi 2658dc712d build: move --cplayer to build options
This way it’s near to it’s libmpv counterparts
2014-11-28 15:57:13 +01:00
Stefano Pigozzi b4deba7cc9 build: move --dvbin to TV features, remove --dvb 2014-11-28 15:57:04 +01:00
Stefano Pigozzi 8fcd4b572a build: fix typos
thanks to @Nikoli
2014-11-28 15:40:55 +01:00
James Ross-Gowan c67048827e subprocess-win: remove a Vista-only flag
PIPE_REJECT_REMOTE_CLIENTS isn't supported on XP. It's not really
needed, so remove it. Also fix error checking for CreateNamedPipe.
2014-11-28 21:20:49 +11:00
wm4 fd66ea7d93 demux_mkv: simplify extradata handling
It was more complicated than necessary.

The behavior changes slightly. Now it might pass through extradata when
it didn't before (hopefully harmless), and doesn't fail with an error if
extradata is not available, even though it's needed (harmless, will fail
either way).
2014-11-27 22:43:38 +01:00
wm4 6d25435364 demux_mkv: cosmetics 2014-11-27 22:24:32 +01:00
wm4 4ea094ac7e demux_mkv: fix a possible out of bounds access
The if branch has a weak check to test whether the codec_id is the short
ID, and handles the long IDs in the else branch. The long IDs are all
longer than 12 bytes long, so hardcoding the string offset to get the
trailing part of the name makes sense. But the if condition checks for
another thing, which could get the else branch run even if the codec_id
is short.

Fix the bogus control flow and check if the codec_id is long enough. One
of these checks could be considered redundant, but include them both for
defensive coding.
2014-11-27 21:54:37 +01:00
wm4 4a83f3df11 ao_wasapi: don't treat SetDisplayName() failure as fatal
Same for SetIconPath().
2014-11-27 20:05:29 +01:00
wm4 5db162231e vo_direct3d: check whether D3DFMT_A8 is available
I suspect this is what is happening in github issue #1265 (at least
partially).

If D3DFMT_A8 is not available, fall back to RGBA. This is less efficient
in general, so we normally want to avoid it.
2014-11-27 20:05:29 +01:00
wm4 4495044947 gl_video: minor simplification
Not needed anymore.
2014-11-27 19:48:15 +01:00
wm4 78f0cb9281 command: sub_add with "auto" should not always select a subtitle track
Running "sub_add file.srt auto" during hook execution automatically
selected the first added track. This happened because all tracks added
with sub_add are marked as "external", and external subtitles are always
selected by default.

Fix this by negating the "external" flag when autoselecting subtitles
during loading. The no_default flag exists for this purpose; it was
probably added for libquvi originally, where we had the same issue.
2014-11-27 18:57:18 +01:00
wm4 a3026c9640 audio: alternative fix for previous commit
This is a somewhat obscure situation, and happens only if audio starts
again after it has ended (in particular can happens with files where
audio starts later). It doesn't matter much whether audio starts
immediately or some milliseconds later, so simplify it.
2014-11-27 18:52:22 +01:00
wm4 0ed77ca7e2 audio: fix busy loop when seeking while paused
When playing paused, the amount of decoded audio is limited to a small
amount (1 sample), because we don't write any audio to the AO when
paused. The small amount could trigger the case of the wanted audio
being too far in the future in the PTS sync code, which set the audio
status to STATUS_DRAINING, which in turn triggered the EOF code in the
next iteration. This was ok, but unfortunately, this triggered another
retry in order to check resuming from EOF by setting the status to
STATUS_SYNCING, which in turn lead to the busy loop by alternating
between the 2 states. So don't try resyncing while paused.

Since the PTS syncing code also calls ao_reset(), this could cause the
pulseaudio daemon to consume some CPU time as well.

This was caused by commit 33b57f55. Before that, the playloop was merely
run more often, but didn't cause any problems.

Fixes #1288.
2014-11-27 10:19:28 +01:00
wm4 a98f88a12f mixer: don't show softvol neutral marker on OSD if not using softvol
Also fix the comment on the softvol field.
2014-11-27 10:11:55 +01:00
Niklas Haas b584802813 vo_opengl: Linearize non-RGB sRGB files correctly (eg. JPEG)
Signed-off-by: wm4 <wm4@nowhere>
2014-11-26 21:44:36 +01:00
wm4 cc54377463 Do not call strerror()
...because everything is terrible.

strerror() is not documented as having to be thread-safe by POSIX and
C11. (Which is pretty much bullshit, because both mandate threads and
some form of thread-local storage - so there's no excuse why
implementation couldn't implement this in a thread-safe way. Especially
with C11 this is ridiculous, because there is no way to use threads and
convert error numbers to strings at the same time!)

Since we heavily use threads now, we should avoid unsafe functions like
strerror().

strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and
gives the function different semantics than the POSIX one. It's a bit of
work to convince this piece of shit to expose the POSIX standard
function, and not the messed up GNU one.

strerror_l() is also in POSIX, but only since the 2008 standard, and
thus is not widespread.

The solution is using avlibc (libavutil, by its official name), which
handles the unportable details for us, mostly. We avoid some pain.
2014-11-26 21:21:56 +01:00
wm4 3fe57e3cb6 gl_common: factor context creation
Always create the context in mpgl_init(), instead of doing it when
mpgl_config_window() is called the first time. This is a small step
towards cleaning up the GL backend interface, and adding other things
like perhaps GLES support, or a callback-driven backend for libmpv.
2014-11-26 20:48:18 +01:00
Niklas Haas 7e62f2b052 vo_opengl: Reword comment in shader
I didn't quite understand this comment after looking at the code again
months later, so I reworded it for better clarity.
2014-11-26 20:31:59 +01:00
wm4 fc0ea3a541 vo_opengl: make operator precedence explicit
More readable.
2014-11-26 20:03:20 +01:00
wm4 cebb3ba645 vo_opengl: fix srgb with certain inputs
Sampling from the source texture and scaling must always be done
separately in this mode.

Fix suggested by haasn.

Still looks a bit wrong, though.
2014-11-26 20:02:55 +01:00