1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-20 06:46:55 +00:00
Commit Graph

40016 Commits

Author SHA1 Message Date
wm4
a9db58cc3b vo_opengl_old: fix OSD regression
Commit 0e8fbdbd removed the rg_texture requirement from vo_opengl;
commit 541f6731 changed to a more convenient method. Both commits broke
vo_opengl_old in some ways. vo_opengl_old always requires GL_ALPHA for
single-channel texture, because it draws the OSD without shaders and by
using certain blend modes.

So we need to explicitly distinguish between vo_opengl and vo_opengl_old
in the OSD renderer, and force fixed texture formats for vo_opengl_old.
The other logic is specific to the internals of vo_opengl. (Although it
might be possible to get the same result by playing with the old GL
fixed-function functions in vo_opengl_old. But seems like a waste of
time.)

Fixes #1370.

Conflicts:
	video/out/gl_osd.c
2015-01-25 17:00:14 +09:00
wm4
21c4c50ac6 vo_opengl: remove pointless glFinish calls 2015-01-25 17:00:13 +09:00
wm4
86493730b2 command: ignore chapter cycling if there's only 1 chapter
If there's only 1 chapter, the seeking by chapter (using the chapter
property) will either jump to the chapter point, or quit playback. This
is as designed, but seems like a useless and annoying behavior.

Conflicts:
	player/command.c
2015-01-25 17:00:13 +09:00
wm4
87e635e843 x11: fix mysterious issue with window embedding on OpenBox
For some reason, when using window embedding, and the window manager is
OpenBox, calling XSetWMNormalHints() before the window is mapped, the
initial window position will be off. It leaves some vertical space,
instead of placing it on the top/left corner. Suspiciously, the vertical
space is as much as a the height of normal window decoration.

I don't know what kind of issue this is. Possibly an OpenBox bug, but
then this happens even if the override-redirect flag is set. (This flag
basically tells the X server to ignore the window manager. Normally we
don't set it.) On other window managers, it works fine. So I don't know
why this is happening.

But this is easy to workaround. XSetWMNormalHints() isn't needed at all
if embedding.

Should fix #1235.
2015-01-25 17:00:13 +09:00
wm4
b0759abe9c x11: copy WinID option
For the purpose of making "--wid" setable at any time.
2015-01-25 17:00:13 +09:00
wm4
ebd4bf9792 player: fix random crashes on uninitialization
On uninitialization, the player will unselect all subtitles, and then
destroy the subtitle decoder. But it didn't correctly remove the
subtitle decoder from the OSD state, so it could happen that it would
access it after the decoder was destroyed.

Could lead to random crashes when switching files often.

Fixes #1389.
2015-01-25 17:00:13 +09:00
wm4
ab4c857ff6 player: cosmetics: rename a function
Something which has this many important sideffects shouldn't start have
a "get" prefix.

Conflicts:
	player/sub.c
2015-01-25 17:00:13 +09:00
wm4
e3f4491a24 demux_mkv: enable codec parsing for vfw-muxed files too
For some codecs, we need to invoke a codec parser (because libavcodec
will run into trouble otherwise). This was done based on the Matroska
codec field.

But this ignores handling of vfw-muxed files, which use a pseudo-codec
to signal presence of vfw structures, which we must unmangle to get the
real codec. Handle this by rearranging the code.

This fixes at least mp3-in-mkv for vfw-muxed files; typically old files.

Conflicts:
	demux/demux_mkv.c
2015-01-25 17:00:13 +09:00
wm4
12ee2e64be client API: fix mpv_wakeup()
Of course this was going to get stuck in the retry loop.

Fixes #1372.
2015-01-25 17:00:13 +09:00
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