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

39943 Commits

Author SHA1 Message Date
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
wm4
3d94938246 command: stip path from playlist OSD display
But only if it's not e.g. a http URL.

Fixes #1388.
2015-01-25 17:00:15 +09:00
Stefano Pigozzi
d627c579ea ao_coreaudio: remove useless guard
useless after 069016fd6c
2015-01-25 17:00:15 +09:00
Stefano Pigozzi
752dd2ef76 ao_coreaudio: fix some naming conventions 2015-01-25 17:00:15 +09:00
Stefano Pigozzi
562e42f826 ao_coreaudio: fix channel mapping
There where 3 major errors in the previous code:

1) The kAudioDevicePropertyPreferredChannelLayout selector returns a single
   layout not an array.
2) The check for AudioChannelLayout allocation size was wrong (didn't account
   for variable sized struct).
3) Didn't query the kAudioDevicePropertyPreferredChannelsForStereo selector
   since I didn't know about it's existence.

All of these are fixed.

Might help with #1367
2015-01-25 17:00:15 +09:00
Stefano Pigozzi
ad3d8ce5c6 ao_coreaudio: fix typo 2015-01-25 17:00:15 +09:00
Stefano Pigozzi
777bffd307 ao_coreaudio: move some code to make output readable 2015-01-25 17:00:15 +09:00
Stefano Pigozzi
7f839323cb ao_coreaudio: add more layout debug outputs
Should help remote debugging #1367 with --msg-level=ao=debug
2015-01-25 17:00:15 +09:00
Stefano Pigozzi
cb4b28e336 ao_coreaudio: fix AudioChannelLayout allocations
AudioChannelLayout uses a trailing variable sized array so we need to
query CoreAudio for the size of the struct it is going to need (or the
conversion of that particular layout would fail).

Fixes #1366
2015-01-25 17:00:14 +09:00
Stefano Pigozzi
35be53108e ao_coreaudio: fix mono/stereo channel mapping
Needed after af3bbb800d since now we use channel mapping all the time.

Fixes #1357
2015-01-25 17:00:14 +09:00
wm4
9f4d44f8c7 stream_pvr: increase timeout, slightly better error reporting
An attempt to find out what's wrong with issue #1382.

I don't even know why a timeout would be needed; for robustness with
broken devices maybe?
2015-01-25 17:00:14 +09:00
wm4
d60940a080 stream: always disable cache for pseudo-streams
Streams which don't have a full_buffer function never return any actual
data. Slight improvement over commit 5640c195.
2015-01-25 17:00:14 +09:00
wm4
dab7602a89 client API: document requirement to block SIGPIPE
I noticed that the IPC code does not use MSG_NOSIGNAL or SO_NOSIGPIPE.
The former is "only" POSIX 2008 and also requires switching to sendto(),
while the latter is even less portable.

Not going to bother with this obsolete 80ies crap, just block SIGPIPE,
and instruct client API users to do the same.
2015-01-25 17:00:14 +09:00
wm4
37210f0cbc ipc: report some user errors better
Using the IPC with a program, it's not often obvious that a newline must
be sent to terminate a command. Print a warning if the connection is
closed while there is still uninterpreted data in the buffer.

Print the OS reported error if reading/writing the socket fails. Print
an erro if JSON parsing fails.

I considered silencing write errors if the write end is closed (EPIPE),
because a client might send a bunch of commands, and then close the
socket without wanting to read the reply. But then, mpv disconnects
without reading further commands that might still be buffered, so it's
probably a good idea to always print the error.
2015-01-25 17:00:14 +09:00
wm4
f24b8cbd47 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.
2015-01-25 17:00:14 +09:00
wm4
b706198207 stream_edl: disable caching
stream_edl merely makes demux_edl act "special", which checks for the
stream type explicitly and then does something with its URL. If a cache
is added before the stream, it'll try to use the cache's URL (i.e. an
empty string), and will then obviously fail to parse the URL. While this
is slightly stupid, just disabling the entirely useless cache is the
most effective solution.

Fixes #1378.
2015-01-25 17:00:14 +09:00
wm4
e213e20c2d demux_mkv: use attachment filename as coverart title 2015-01-25 17:00:14 +09:00
wm4
2ade5c8477 demux_mf: add probing by mime type
Reuses the mime type table introduced in the previous commit.
2015-01-25 17:00:14 +09:00
wm4
15a191f920 demux_mkv: support embedded coverart
The code could as well be in demux.c, but it's better to avoid
accidental clashes with demux_lavf.c.

FFmpeg provides no way yet to map a mime type to a codec, so do it
manually. (It _can_ map a mime type to an "input format", but not a
codec.)

Fixes #1374.
2015-01-25 17:00:14 +09:00
wm4
899822c001 old-configure: fix disabling VAAPI GLX with --disable-gl
waf handles this correctly.
2015-01-25 17:00:14 +09:00
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