Commit Graph
39907 Commits
Author SHA1 Message Date
wm4 ead565afb3 client API: be more lenient about mpv_suspend/resume mismatches
Before this commit, this was defined to trigger undefined behavior. This
was nice because it required less code; but on the other hand, Lua as
well as IPC support had to check these things manually. Do it directly
in the API to avoid code duplication, and to make the API more robust.
(The total code size still grows, though...)

Since all of the failure cases were originally meant to ruin things
forever, there is no way to return error codes. So just print the
errors.
2015-01-25 17:00:13 +09:00
wm4 9f80936ddc player: update chapter marks when switching files
This wasn't done, so the chapter marks of the previous file were
visible. It's harmless, but looks unpolished, so fix it.

Conflicts:
	player/command.c
2015-01-25 17:00:13 +09:00
wm4 6a8dad4c3a manpage: update the ao_alsa example (no-block was removed)
Also, don't use the "hw" device, but "plughw". ALSA docs say never to
use "hw".
2015-01-25 17:00:13 +09:00
wm4 3d710630a4 vo_opengl: don't use 10 bit video on Intel GPUs
vo_opengl was originally written against OpenGL 3 core, and it seems
GPUs/drivers supporting this are mostly sane. Later, it was made to work
with OpenGL 2.1 too. Lately we removed the requirement for RG textures,
and look, someone reported a problem with "lesser" Intel GPUs.

This commit does the same in vo_opengl what was added to vo_opengl_old a
long time ago.

Fixes #1383.

Conflicts:
	video/out/gl_common.c
	video/out/gl_video.c
2015-01-25 17:00:13 +09:00
wm4 f83e28d893 vo_opengl: remove requirement for RG textures
Features not supported are disabled (although with a misleading error
message).

Conflicts:
	video/out/gl_video.c
	video/out/vo_opengl.c
	video/out/vo_opengl_cb.c
2015-01-25 17:00:12 +09:00
wm4 3f66dd82b1 vo_opengl: never use 1D textures for lookup textures
This was a microoptimization for small filters which need 4 or less
weights per sample point. When I originally wrote this code, using a 1D
texture seemed to give a slight speed gain, but now I couldn't measure
any difference.

Remove this to simplify the code.
2015-01-25 17:00:12 +09:00
wm4 c4c95f0dde vo_opengl: refactor: merge convolution function and sampler entrypoint
There's not much of a reason to have the actual convolution code in a
separate function. Merging them actually simplifies the code a bit, and
gets rid of the repetitious macro invocations to define the functions
for each filter size.

There should be no changes in behavior or output.
2015-01-25 17:00:12 +09:00
wm4 60c6307a97 vo_opengl: extend filter size to 64
For better downscaling.

Maybe the list of filter sizes shouldn't be static...
2015-01-25 17:00:12 +09:00
wm4 99f237beb9 vo_opengl: extend filter size to 32
Also replace the weights calculations for 8/12/16 with the generic
weight function definition macro. (The weights 2/4/6 follow slightly
different rules.)
2015-01-25 17:00:12 +09:00
wm4 6cf54d6bc0 gl_video: minor simplification
Not needed anymore.
2015-01-25 17:00:12 +09:00
Kevin Mitchell c6ce2c6b43 ao/wasapi: make set_ao_format EX/EXTENSIBLE agnostic
There is no guarantee that closestMatch returned by IsFormatSupported
is actually a WAVEFORMATEXTENSIBLE.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd370876%28v=vs.85%29.aspx

We should therefore not blindly treat it as such.
2015-01-25 17:00:12 +09:00
Kevin Mitchell 7f92344138 ao/wasapi: fix set_ao_format
Before it used whatever was in ao->format and changed the bits even
though this might have nothing to do with the actual WAVEFORMAT
negotiated with WASAPI.

For example, if the initial ao->format was a float and we had set the
WAVEFORMAT to s24, this would create a non-existent float24 format.
Worse, it might put an u16 into ao->format when WAVEFORMAT described s16.
WASAPI doesn't support unsigned at all as far as I can tell.
2015-01-25 17:00:12 +09:00
Kevin Mitchell d56a1112d2 ao/wasapi: show actual waveformat tried
also remove bogus ao_format
2015-01-25 17:00:12 +09:00
Kevin Mitchell b1292c044a ao/wasapi: don't assume 32-bits == float
This was based on old WAVEFORMATEX restrictions
http://msdn.microsoft.com/en-us/library/windows/hardware/ff538799%28v=vs.85%29.aspx

With the new WAVEFORMATEXTENSIBLE, this is no longer a problem. and we
can have s32 or float32 so we need to actually check / set these correctly.

fixes #1287
2015-01-25 17:00:12 +09:00
Kevin Mitchell 18fb4bff6f ao/format: add af_fmt_is_float 2015-01-25 17:00:12 +09:00
Kevin Mitchell 7e60fb2c97 ao/wasapi: make sure that < 16-bit pcm never happens
it just sucks. noone should have to listen to that.
2015-01-25 17:00:12 +09:00
Kevin Mitchell 8c8af64820 ao/wasapi: get rid of WAVEFMT union
It only confused the issue. Replace it's functionality with
waveformat_copy function where needed.
2015-01-25 17:00:12 +09:00
wm4 3ee6992656 manpage: rename input.conf supersection
By now, input.conf is actually just a small part of input handling.
Rename the section to something else ("command interface" was the
first reasonable thing that came to mind).

Also fix a minor typo further down.
2015-01-25 17:00:12 +09:00
wm4 9a7f332571 manpage: lua: fix example
Oops.
2015-01-25 17:00:11 +09:00
wm4 fadf87f2a7 manpage: minor fixes
Also update the Lua example. The "pause" event was declared deprecated,
so the example should use the newer API.
2015-01-25 17:00:11 +09:00
wm4 62c7a372ec 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.)
2015-01-25 17:00:11 +09:00
wm4 0692da3007 command: avoid returning invalid FPS values
It's possible that fps is sometimes 0 in case it's unset.
2015-01-25 17:00:11 +09:00
wm4 0fcb96139d 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.
2015-01-25 17:00:11 +09:00
wm4 5f6b5feac6 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.
2015-01-25 17:00:11 +09:00
wm4 e2a4fde6de 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.
2015-01-25 17:00:11 +09:00
Kevin Mitchell 01401b5f5b ao/wasapi: handle VistaBlob failure more gracefully 2015-01-25 17:00:11 +09:00
Kevin Mitchell f794eca255 ao/wasapi: remove unnecessary check of audio thread input
it would have caused a deadlock if it fired anyway.
2015-01-25 17:00:11 +09:00
Kevin Mitchell ad2a461a09 ao/wasapi: more consistent/reliable method of computing extra WAVEFORMATEXTENSIBLE size 2015-01-25 17:00:11 +09:00
Kevin Mitchell 2e931b34f4 ao/wasapi: more missed cleanup on failure 2015-01-25 17:00:11 +09:00
Kevin Mitchell ade8b6214d ao/wasapi: check return values
Only issue a warning for failure of wasapi_enumerate_devices and
wasapi_fill_VistaBlob.
2015-01-25 17:00:11 +09:00
Kevin Mitchell 78e957a2bd 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).
2015-01-25 17:00:11 +09:00
Kevin Mitchell 9eb75631c7 ao/wasapi: check full GUID of KSDATAFORMAT to determine float 2015-01-25 17:00:11 +09:00
Kevin Mitchell 0c8a419775 ao/wasapi: expose GUID and PKEY convenience functions
Give them the prefix mp_ and make them nonstatic.
2015-01-25 17:00:10 +09:00
Kevin Mitchell 885c6e5b07 ao/wasapi: remove unused variable 2015-01-25 17:00:10 +09:00
Kevin Mitchell 44a7649e79 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
2015-01-25 17:00:10 +09:00
Kevin Mitchell fded4de8a7 ao/wasapi: avoid redundant passing of ao and wasapi_state as arguments
also drop some useless const declaraitons
2015-01-25 17:00:10 +09:00
Kevin Mitchell f20575f3dd 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.
2015-01-25 17:00:10 +09:00
Kevin Mitchell 1936cfdb09 ao/wasapi: fix unmatched CoUninitialize() on init failure 2015-01-25 17:00:10 +09:00
Kevin Mitchell 84c2dc882d ao/wasapi: more debugging messages 2015-01-25 17:00:10 +09:00
Kevin Mitchell d72718ca65 ao/wasapi: simplify the init retry 2015-01-25 17:00:10 +09:00
Kevin Mitchell 8a73b02952 ao/wasapi: make get_device_delay return an error code 2015-01-25 17:00:10 +09:00
wm4 b4174ab4e9 ao_wasapi: don't treat SetDisplayName() failure as fatal
Same for SetIconPath().
2015-01-25 17:00:10 +09:00
wm4 ce5f0f1a7a demux_playlist: detect headerless m3u files by extension
m3u files are normally just text files with a list of filenames. Nothing
actually mandates that there is a header. Until now, we've rejected such
files, because there's absolutely no way to detect them.

If nothing else claims the file, the extension is ".m3u", and if the
contents of the file look like text, then load it as m3u playlist. The
text heuristic is pretty cheap, but at least it should prevent trying
to load binary data as playlist. (Which would "work", but result in a
catastrophic user experience.)

Due to the text heuristic, UTF-16/32 files will be rejected (unless they
have a header), but I don't care.
2015-01-25 17:00:10 +09:00
ChrisK2 e02146b0c0 ytdl_hook: Check for empty playlists
Sometimes we get empty playlists back, print a warning message
instead of crash
2015-01-25 17:00:10 +09:00
James Ross-Gowan 804468b1ac subprocess-win: Always quote argv[0]
If the program name isn't quoted and the .exe it refers to isn't found,
CreateProcess will add the program arguments to the program name and
continue searching, so for "program arg1 arg2", CreateProcess would try
"program.exe", "program arg1.exe", then "program arg1 arg2.exe". This
behaviour is weird and not really desirable, so prevent it by always
quoting the program name.

When quoting argv[0], escape sequences shouldn't be used. msvcrt, .NET
and CommandLineToArgvW all treat argv[0] literally and end it on the
trailing quote, without processing escape sequences.
2015-01-25 17:00:10 +09:00
wm4 d8455f34c1 player: respect --untimed on last frame
The last video frame is another case that has a separate code path,
although it's pretty similar to the one in commit 73e5aa87. Fix this
in a different way, which also takes care of the last frame case,
although without context the code becomes slightly more tricky.

As further cleanup, move the decision about framedropping itself to
the same place, so the check in vo.c becomes much simpler. The check
for the vo->driver->encode flag, which is remvoed completely, was
redundant too.

Fixes #1480.
2015-01-25 17:00:10 +09:00
wm4 b0877e5454 player: respect --untimed on video format changes
If the video format changes (e.g. different frame size), a special code
path is entered to wait until the currently displayed frame is done.
Otherwise, the frame before the change would be destroyed by the
vo_reconfig() call.

This code path didn't respect --untimed; correct this.

Fixes #1475.
2015-01-25 17:00:09 +09:00
wm4 c926927c59 player: don't fall asleep on audio decoding errors
This makes it retry later.

Fixes #1474.
2015-01-25 17:00:09 +09:00
wm4 9af1ff9817 player: fix --stop-playback-on-init-failure on audio init failure
This was forgotten when the option was implemented, and makes this
option work as advertised.

Fixes #1473 (though the default behavior is probably still stupid).
2015-01-25 17:00:09 +09:00
wm4 ca34fd569d image_writer: check for conversion errors
This can happen when e.g. a VO returns a screenshot in an unsupported
format.
2015-01-25 17:00:09 +09:00