Commit Graph
41219 Commits
Author SHA1 Message Date
wm4 b2f44f131f vo_drm: don't mutate the current frame when clamping for panscan
When running with --panscan=1, this could crash - because the current
frame was reduced in size each time the image was redrawn, which would
result in a failed assertion the second time it's drawn.

(cherry picked from commit 859ddc9906)
2015-05-09 21:15:15 +09:00
wm4 5f81da0b88 input: filter out redundant mp_input_set_mouse_pos() calls
Prevents the OSC from showing up on start on Cocoa.

(cherry picked from commit 51120c9c7f)
2015-05-09 21:15:04 +09:00
wm4 01c452cfba audio: simplify further
Drop mp_chmap_diff() (which is unused too now), and implement
mp_chmap_diffn() in a slightly simpler way. (Too bad there is no
standard function for counting set bits.)

(cherry picked from commit 00130651da)
2015-05-09 21:14:51 +09:00
wm4 ba799895e1 audio: remove mp_chmap_contains()
It's unsued now.

(cherry picked from commit 8d5924f2c9)
2015-05-09 21:14:35 +09:00
wm4 438ae9f742 ao: log reordered versions of channel maps
Useful for debugging cases when no standard orders are used.

(cherry picked from commit 8b7035c8ff)
2015-05-09 21:14:25 +09:00
wm4 015a7638fb audio: redo channel map fallback selection
Instead of somehow having 4 different cases with each their own weight,
do it with a single function that decides which channel layout is the
better fallback.

This is simpler, and also introduces new (fixed) semantics. The new test
added to test/chmap_sel.c actually works now. This is a mixed case with
no perfect upmix or downmix, but the better choice is the one which
loses the least channels from the original layout.

One test also changes. If the input is 7.1(wide-side), and the available
layouts are 7.1 and 5.1(side), the latter is now chosen instead of the
former. This makes sense: both layouts contain 6 out of 8 channels from
the original layout, but the 5.1(side) one is smaller. This follows the
general logic. The 7.1 layout has FLC/RLC speakers instead of BL/BR,
and judging by the names, "front left center" is completely different
from "back left". If these should be exchangeable, a separate exception
would have to be added.

(cherry picked from commit 3560a50029)
2015-05-09 21:14:15 +09:00
wm4 1f4e087e6f test: simplify chmap_sel tests
(cherry picked from commit 5142b0e3f3)
2015-05-09 21:14:00 +09:00
wm4 0ed627d5ab audio: remove UNKNOWN pseudo speakers
Reuse MP_SPEAKER_ID_NA for this. If all mp_chmap entries are set to NA,
the channel layout has special "unknown channel layout" semantics, which
are used to deal with some corner cases.

(cherry picked from commit 55e777f10b)
2015-05-09 21:13:52 +09:00
wm4 1127bb41c2 audio: define only a single NA speaker ID
Remove the requirement from mp_chmap that speaker entries must be
unique. Use this to get rid of all the redundant NA speaker IDs.

(cherry picked from commit b91b4944bd)
2015-05-09 21:13:21 +09:00
wm4 f58646c85c audio: add chmap utility function
(cherry picked from commit d32b71d52e)
2015-05-09 20:18:54 +09:00
wm4 d224c89034 ao_alsa: log requested numbers of channels if ALSA rejects them
(cherry picked from commit ad9bce2a5c)
2015-05-09 20:18:35 +09:00
Diogo Franco (Kovensky) 63b92944d0 Revert "csputils: apply contrast equalizer in RGB"
This reverts commit af930e2a2e.

Better avoid big behavior changes within a release series.
2015-05-08 16:40:01 +09:00
Diogo Franco (Kovensky) d939de5a71 Update RELEASE_NOTES 2015-05-08 16:38:46 +09:00
wm4 0f834d0d5a audio: fix messed up assert()
This made no sense and always evaluated to true.

(cherry picked from commit 7b09654c33)
2015-05-08 16:38:46 +09:00
wm4 375437f204 m_config: make m_config_set_profile() use a name
Is simpler and avoids exposing profile structs to a degree.

(cherry picked from commit 036a49478f)
2015-05-08 16:38:46 +09:00
wm4 ceea08d7fe DOCS: add a link to LIRC wiki entry
(cherry picked from commit b12ca2b980)
2015-05-08 16:38:46 +09:00
wm4 b76df84687 ao_coreaudio_utils: don't list some formats as "unusable"
While mpv has no internal equivalent representation, they can still be
used as physical CoreAudio formats. Thus this label is confusing.

(cherry picked from commit 1bcb82ec93)
2015-05-08 16:38:46 +09:00
ChrisK2 8db3a5b3e4 ytdl_hook: Escape EDL URLs
Should prevent the EDL parser from tripping over = and , in the
URL.

(cherry picked from commit 6a0a67034d)
2015-05-08 16:38:45 +09:00
wm4 eccea21361 ao_sndio: add notice about padding channels
(I won't do this, but someone else seeing this might.)

(cherry picked from commit cd5ab98ff9)
2015-05-07 10:55:34 +09:00
wm4 52ed30e9b8 ao_alsa: use new padding channels support
Sometimes, ALSA will return channel layouts with padded channels (NA
speakers). Use them instead of failing.

This still includes the old "braindeath" code to retry with a layout
without NA channels. This might be helpful for performance, and also the
padded channel layout string looks confusing.

To be fair, I have not encountered a case yet which would really need
this, and for which the old "braindeath" code did not fix it.

(cherry picked from commit 85fc6b2a05)
2015-05-07 10:54:49 +09:00
wm4 76d2ba6283 ao_alsa: move ALSA -> mp channel map to a function
One side effect is that the warning about too many channels goes away,
and is replaced with printing the ALSA channel map as "unknown".

(cherry picked from commit d577872a28)
2015-05-07 10:54:32 +09:00
wm4 048cd1e73d manpage: do not use deprecated syntax in example
(cherry picked from commit 9434aa75b2)
2015-05-07 10:54:10 +09:00
wm4 d7cfe38f06 cocoa: remove an unused parameter
(cherry picked from commit f58d3591d9)
2015-05-07 10:53:55 +09:00
wm4 283a300aa9 ao_coreaudio_exclusive: check new format before waiting for change
It seems if the format was already set, setting the same format will
not cause a property change.

(cherry picked from commit 0ae0e90eb5)
2015-05-07 10:53:47 +09:00
wm4 099f2138bb ao_coreaudio_exclusive: use atomics instead of volatile
volatile barely means anything.

The polling is kind of bad too, but relatively harmless as device
opening/closing is a rare event, and the format change is not expected
to take long.

Remove the pointless talloc call too (must have been a leftover
from previous refactoring).

(cherry picked from commit 4444ff48fa)
2015-05-07 10:53:37 +09:00
wm4 b7ef055917 ao_coreaudio_exclusive: rename "digital" -> "compressed"
PCM is digital too.

(cherry picked from commit 028739932b)
2015-05-07 10:53:25 +09:00
wm4 4002258b3f ao_coreaudio_exclusive: explicitly check for spdif formats
(cherry picked from commit 1e1045b13e)
2015-05-07 10:53:18 +09:00
wm4 3b471462eb ao_coreaudio_exclusive: merge init_digital() function
No reason to keep them separate. It's an artifact from the old
ao_coreaudio.c, which kept usage of two different APIs in the same file.
Removes a forward reference too.

(cherry picked from commit 32bc61ae07)
2015-05-07 10:52:50 +09:00
wm4 9b41d17dc0 cocoa: lock cocoa main thread on uninit
This should fix some crashes due to dangling pointers.

The problem was that with_cocoa_lock_on_main_thread() is asynchronous.
It will not wait until it is finished. In the uninit case, this means
the VO could be deallocated and destroyed while cocoa was still running
uninit code.

So simply wait until it is done by using dispatch_sync(). There were
concerns that this could introduce a deadlock by the main thread trying
to wait for something on the VO thread. But from what I can see, this
never happens, and even if it does, it would crash anyway since the VO
is already gone.

One remaining worry is the video_resize_redraw_callback. From what I can
see, it still can mess things up, and will need a more elaborate fix.

(cherry picked from commit e777756301)
2015-05-07 10:52:39 +09:00
wm4 5523c04af5 ao_coreaudio_utils: decide formats by comparing raw bits
Instead of trying to use af_format_conversion_score() (which tries to be
all kinds of clever), just compare the raw bits as a quality measure. Do
this because otherwise, weird formats like padded 24 bit formats will be
excluded, even though they might be the highest precision formats for
some hardware.

This means that for now, the user would have to check whether the format
is usable at all before calling ca_asbd_is_better(). But since this is
currently only used for ao_coreaudio.c and for the physical format, it
doesn't matter.

If coreaudio-exclusive should get PCM support, the best would be to
revert this change, and to add support for 24 bit formats directly.

(cherry picked from commit 4ffcf2531b)
2015-05-07 10:52:02 +09:00
wm4 625fb59d08 af: don't attempt to remove last filter for spdif filter removal
Some time ago, a mechanism was added for automatically removing PCM-only
filters if the input format is spdif.

This could cause an infinite loop if the AO did not support spdif, but
was falling back to some PCM format. Then this code tried to remove the
last filter, which is a dummy filter for receiving and queuing filter
output. af_remove() simply fails gracefully in this case, so this
happens over and over again.

Fix by explicitly checking whether the filter to remove is a dummy
filter. (af_remove() also fails only if the dummy filters are attempted
to be removed - checking this directly is simpler.)

(cherry picked from commit 0025030cef)
2015-05-07 10:51:30 +09:00
wm4 71a88d75ff audio: minor cosmetics
These ( ) were probably not removed when the format constants were
changed from defines to an enum.

(cherry picked from commit d76f9a484e)
2015-05-07 10:50:59 +09:00
wm4 938008fff1 ao_coreaudio_utils: don't require talloc for fourcc_repr()
Instead, apply a trick to make the caller allocate enough space on the
stack.

(cherry picked from commit 399267393b)
2015-05-07 10:50:32 +09:00
wm4 d723970279 ao_coreaudio_utils: unbreak default device selection
It appears this is the reason coreaudio-exclusive does not work without
explicitly specifying a device, even if the default device maps to
something passthrough-capable.

(cherry picked from commit 7a5f5a8adf)
2015-05-07 10:49:20 +09:00
wm4 0e37672270 ao_coreaudio_exclusive: fix latency calculation non-sense
Didn't use the properties it was supposed to use.

(cherry picked from commit bbedceb467)
2015-05-07 10:48:44 +09:00
wm4 2d35c84ebf ao_coreaudio_utils: refine format selection
Instead of always picking a somehow better format over the previous one,
select a format that is equal to or better the requested format, but is
also reasonably close.

Drop the mFormatID comparison - checking the sample format handles this
already.

Make sure to exclude channel counts that can't be used.

(cherry picked from commit fd6809f98a)
2015-05-07 10:48:34 +09:00
wm4 bdbbf4ae48 vo_opengl: change default FBO format
Reduces (but likely does not remove) the danger of rounding intermediate
values down to 8 bit. This is important for cscale, or any other
processing that might store raw YUV values in framebuffers.

Fixes #1918.

(cherry picked from commit cf210c4ffc)
2015-05-07 10:47:51 +09:00
wm4 774e9ef261 ao_coreaudio_utils: add a format negotiation helper function
(cherry picked from commit 305a85cc9a)
2015-05-07 10:47:21 +09:00
wm4 b38766133b ao_coreaudio: support padded channel layouts
If for example the audio settings are set to 5.1 output, but the
hardware does 8 channels natively (HDMI), the reported channel
layout will have 2 dummy channels. To avoid falling back to stereo,
we have to write audio in this format to the device.

(cherry picked from commit 4d8a7e0394)
2015-05-07 10:47:07 +09:00
wm4 604daa861f audio: introduce support for padding channels
Some audio APIs explicitly require you to add dummy channels. These are
not rendered, and only exist for the sake of the audio API or hardware
strangeness. At least ALSA, Sndio, and CoreAudio seem to have them.

This commit is preparation for using them with ao_coreaudio.

The result is a bit messy. libavresample/libswresample don't have good
API for this; avresample_set_channel_mapping() is pretty useless.
Although in theory you can use it to add and remove channels, you
can't set the channel counts. So we do the ordering ourselves by making
sure the audio data is planar, and by swapping the plane pointers. This
requires lots of messiness to get the conversions in place. Also, the
input reordering is still done with the "old" method, and doesn't
support padded channels - hopefully this will never be needed. (I tried
to come up with cleaner solutions, but compared to my other attempts,
the final commit is not that bad.)

(cherry picked from commit 06050aed99)
2015-05-07 10:47:00 +09:00
wm4 322c79a6e1 audio: introduce mp_audio readonly bit
Convenience for the following commit.

(cherry picked from commit 1b0b094ca2)
2015-05-07 10:46:53 +09:00
wm4 6bcb8d200f audio: chmap: explicitly drop channels not supported by lavc
Basically as before, but avoid undefined behavior.

(cherry picked from commit 937c8e513f)
2015-05-07 10:46:48 +09:00
wm4 d9c42ff9ff audio: drop unused function
(cherry picked from commit 548cd826c2)
2015-05-07 10:46:41 +09:00
wm4 e0ad4ec8aa ao_coreaudio: fix out of bounds access
ca_label_to_mp_speaker_id() checked whether the last entry was >= 0, but
actually this condition was never true, and MP_SPEAKER_ID_UNKNOWN0 is
not negative.

(cherry picked from commit eead97f103)
2015-05-07 10:46:36 +09:00
James Ross-Gowan 8a46b5b711 subprocess-win: use the correct pipe namespace
This was a mistake, it should definitely be using the device namespace
rather than the file namespace. As it says in the docs, all pipe names
must start with \\.\pipe\

(cherry picked from commit b6381a0ee3)
2015-05-07 10:46:29 +09:00
Niklas Haas 052b6d406d sws_utils: re-use avcolorspace for sws colorspaces
This lets us avoid having to maintain two separate copies of the
colorspace mapping functions.

(cherry picked from commit 08d3ef3d9e)
2015-05-07 10:46:23 +09:00
wm4 f56a7af9f6 win32: fix desktop directory
The folder argument wasn't used, so it always returned the APPDATA dir.

(cherry picked from commit a2da53027b)
2015-05-07 10:46:15 +09:00
wm4 90ba8040d9 win32: move platform specifics to osdep
This will probably disable this code for Cygwin. I don't know if this
matters, since Cygwin should strictly behave like a Unix anyway.

(cherry picked from commit 3508a3fbd1)
2015-05-07 10:45:39 +09:00
wm4 26e779c9aa build: move main-fn files to osdep
And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by
calling mpv_main directly, instead of passing a function pointer. Also
add a comment explaining why Cocoa needs a special case at all.

(cherry picked from commit 1e7831070f)
2015-05-07 10:45:33 +09:00
wm4 fe19db9cc0 cocoa: always compile OSX application code with cocoa
This unbreaks compiling command line player and libmpv at the same
time. The problem was that doing so silently disabled the OSX
application thing - but the command line player can not use the
vo_opengl Cocoa backend without it.

The OSX application code is basically dead in libmpv, but it's not
that much code anyway.

If you want a mpv binary that does not create an OSX application
singleton (and creates a menu etc.), you must disable cocoa
completely, as cocoa can't be used anyway in this case.

(cherry picked from commit 19a5b20752)
2015-05-07 10:45:20 +09:00