| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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 b91b4944bd7ddf6fef4c4254d457117017292c0a)
|
|
|
|
| |
(cherry picked from commit d32b71d52e9a45c141d2bd132189db68613ab0fb)
|
|
|
|
| |
(cherry picked from commit ad9bce2a5ca62f6a64f65fe79ae170edc0e05da4)
|
|
|
|
|
|
| |
This made no sense and always evaluated to true.
(cherry picked from commit 7b09654c33ca81aede475235121ebc938791dc80)
|
|
|
|
|
|
|
| |
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 1bcb82ec93cc3e037df2dd4e2216a473fe87baf9)
|
|
|
|
|
|
| |
(I won't do this, but someone else seeing this might.)
(cherry picked from commit cd5ab98ff992217abfd0234601c21eb0fe0dbc19)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 85fc6b2a0569b24c5652f600d90d7a131b61eb07)
|
|
|
|
|
|
|
| |
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 d577872a28c9729e987566530905bde238af8109)
|
|
|
|
|
|
|
| |
It seems if the format was already set, setting the same format will
not cause a property change.
(cherry picked from commit 0ae0e90eb5348c58d5b4f13fe0792199c460a4b6)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 4444ff48fa578461688fe9feb9ebcd996cd64506)
|
|
|
|
|
|
| |
PCM is digital too.
(cherry picked from commit 028739932bf4e2d32439b3756811a2b06cc81128)
|
|
|
|
| |
(cherry picked from commit 1e1045b13ea4acbbd77dd52c4e0599f1517e6ac3)
|
|
|
|
|
|
|
|
| |
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 32bc61ae07fe441c327b4aa96dd80fa4771fd569)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 4ffcf2531bb525c19c3b6df75ecb27c5cffbdd28)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 0025030cef757327769982333f9105aa510c393d)
|
|
|
|
|
|
|
| |
These ( ) were probably not removed when the format constants were
changed from defines to an enum.
(cherry picked from commit d76f9a484ea7795655637eb0ddc8655aa4fff345)
|
|
|
|
|
|
|
| |
Instead, apply a trick to make the caller allocate enough space on the
stack.
(cherry picked from commit 399267393bb96710cde53c2fc7563f55cc32deb8)
|
|
|
|
|
|
|
|
| |
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 7a5f5a8adf5921ed8fcee29d76113d9a7f018974)
|
|
|
|
|
|
| |
Didn't use the properties it was supposed to use.
(cherry picked from commit bbedceb467033b239b35ee9b2db963a93d8a57c9)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 fd6809f98a546c2abe87b378bb1fe0bbec40a4ef)
|
|
|
|
| |
(cherry picked from commit 305a85cc9aa169a75317acb55e539f49d420f629)
|
|
|
|
|
|
|
|
|
| |
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 4d8a7e03944155bf07ba9a775cf9554bb1c76f0f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 06050aed9906b784159ad03e86e13348c4d9fa47)
|
|
|
|
|
|
| |
Convenience for the following commit.
(cherry picked from commit 1b0b094ca2c25ad162f8f8c84ebebef9a963552e)
|
|
|
|
|
|
| |
Basically as before, but avoid undefined behavior.
(cherry picked from commit 937c8e513f7b948fff0746e80ecf3d27d7007abe)
|
|
|
|
| |
(cherry picked from commit 548cd826c24b7f56b597785f0b83a47cbf4a0465)
|
|
|
|
|
|
|
|
| |
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 eead97f10303436b8da1c75dcdaa79efaba5b015)
|
|
|
|
|
|
|
|
|
|
|
| |
This should for now be equivalent; it's merely more explicit and will
be required if we add PCM support.
Note that the property listeners actually tell you what property
exactly changed, but resolving the current listener mess would be too
hard. So check for changes manually.
(cherry picked from commit 382434d45a72967f5b607c871e363e02dce1f1e6)
|
|
|
|
|
|
| |
As a consequence, it also logs whether mpv can a this format at all.
(cherry picked from commit 34a5229b231f15c95876fed472bd1edc5283db31)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Useful with some of the following commits.
ca_fill_asbd() should behave exactly as before.
Instead of actually implementing the inverse function of ca_fill_asbd(),
just loop over the (small) list of mpv functions and check if any mpv
equivalent to a given ASBD exists.
(cherry picked from commit 32b835c03b4dc98a0344d171adef36c7562f1e7b)
|
|
|
|
|
|
|
|
|
|
|
| |
kAudioFormatFlagIsSignedInteger implicates that it's only used with
integer formats. The mpv internal flag on the other hand signals the
presence of a sign, and this is set on float formats.
Until now, this probably worked fine, because at least AudioUnit is
ignoring the uncorrect flag.
(cherry picked from commit 3295ce48ab4badff0e13e2e9c2a1ec945413d4e2)
|
|
|
|
|
|
|
| |
Should be almost equivalent, unless there are streams on which this call
does not work for unknown reasons.
(cherry picked from commit 8b4ca5806207c1482df30d9815e6970697cea5b2)
|
|
|
|
|
|
| |
Make it easier to distinguish the fields.
(cherry picked from commit d5e9bf66a1e0c4578bd8bef5c9f725dbc47e9fc6)
|
|
|
|
|
|
|
|
|
| |
Whether this is correct is unknown. This change tripples the latency
from ~15ms to ~45ms.
XBMC does this, VLC does not from what I could see.
(cherry picked from commit 5f86fad2f0ab76b7497230b18cd146a7c4d38cd2)
|
|
|
|
|
|
|
|
|
|
| |
We always want to prefer upmix to downmix, as long as it makes sense.
Even if the upmix is not "perfect" (not just adding channels), we want
to prefer the upmix.
Cleanup for commit d3c7fd9d.
(cherry picked from commit c4aa13615501189c55c23448d436074e5f92c8cc)
|
|
|
|
|
|
|
|
|
|
| |
As indicated by the added test. In this case, fallback and downmix have
the same score, but fallback happens to give better results. So prefer
fallback over downmix.
(This is probably not a correct solution.)
(cherry picked from commit d3c7fd9d7c971086a3d6fde5f6f1bc4ef0b2e904)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the old implementation for these properties. It was never very
good, often returned very innaccurate values or just 0, and was static
even if the source was variable bitrate. Replace it with the
implementation of "packet-video-bitrate". Mark the "packet-..."
properties as deprecated. (The effective difference is different
formatting, and returning the raw value in bits instead of kilobits.)
Also extend the documentation a little.
It appears at least some decoders (sipr?) need the
AVCodecContext.bit_rate field set, so this one is still passed through.
|
|
|
|
|
| |
configure_lavrr() clears s->pending, so we have to assign it after that
call.
|
|
|
|
|
|
| |
mp_chmap_from_channels_alsa() doesn't always succeed - there are a bunch
of channel counts for which no defined ALSA layout exists. Fallback to
stereo in this case. (Normally, this code path shouldn't happen at all.)
|
|
|
|
| |
Signed-off-by: wm4 <wm4@nowhere>
|
|
|
|
|
| |
The in/out pointers usually have not much meaning outside of
AF_CONTROL_REINIT. Also remove the redundant casts.
|
|
|
|
| |
It must be allowed to set format==0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It could happen that a lavrresample filter would keep its old output
format when the decoder changed its output format. This simply happened
because the output format was never reset.
Normally, this was not an issue, because lavrresample filters only
inserted for format conversion were removed on format changes. But if
--no-audio-pitch-correction is set and playback speed is changed, then
there is a "permanent" lavrresample filter in the filter chain, which
shows this behavior.
Fix by explicitly resetting output formats for all filters which support
it.
Note: this can crash with libswresample in some cases. I'm not sure if
this is mpv's fault or libswresample's, but since it works with
libavresample, I'm going to assume it's not our's.
|
|
|
|
| |
And also use the correct type for the printf call below.
|
|
|
|
| |
Fixes #1743 and partially #1780.
|
|
|
|
|
|
|
|
|
|
| |
The af_add() function has a problem: if the inserted filter returns
AF_DETACH during init, the function will have a dangling pointer. Until
now this was avoided by making sure none of the used filters actually
return AF_DETACH, but it's getting infeasible.
Solve this by requiring passing an unique label to af_add(), which is
then used instead of the pointer.
|
|
|
|
|
|
|
|
| |
Silence the usually user-visible warning about unsupported channel maps.
This might be an ALSA bug, but ALSA will never fix this behavior anyway.
(Or maybe it's a feature.)
Log some other information that might be useful.
|
|
|
|
|
|
| |
The message log level shouldn't get to decide whether something fails
or not. So replace the fatal error check on the verbose output code
path with a warning.
|
|
|
|
|
|
|
|
|
| |
Unfortunately, because we have proxy objects (pAudioVolumeProxy,
pEndpointVolumeProxy, pSessionControlProxy) it looks like we still
have to use MsgWaitForMultipleObjects and watch for and dispatch
pending messages:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680112%28v=vs.85%29.aspx
|
| |
|
| |
|
|
|
|
|
| |
af_fmt_is_float and af_fmt_is_planar were previously inconsistent with
AF_FORAMT_IS_SPECIAL/AF_FORMAT_IS_IEC61937
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unify passthrough and pcm exclusive mode format setting/testing
* set passthrough format parameters correctly
* support all of mpv's existing passthrough formats
* automatically test passthrough with exclusive mode and enable
exclusive if it succeeds, even if it was not explictly requested.
this obviates the need for --ao=wasapi,wasapi=exclusive
* if passthrough fails (such as the device doesn't support the
format), fallback to either exclusive pcm or shared mode depending
on what the user specified. Right now this isn't very useful as
it still fails due to the decoder path remainin stuck on spdif.
fixes #1742
|
|
|
|
|
|
|
|
|
|
| |
libswresample doesn't normalize when remixing to a float format. This
will cause clipping due to float samples being out of the allowed range.
Fortunately this extremely bad default can be changed.
This does not happen with libavresample: it normalizes by default.
Fixes #1752.
|
| |
|
| |
|
|
|
|
|
|
| |
Per-app volume would change the volume across all instances of the same
application, while a private volume control (HAS_PER_APP_VOLUME)
obviously should influence only one instance/audio stream only.
|
|
|
|
|
| |
CoreAudio doesn't seem to have this concept. The volume is reset the
next time audio is opened.
|
|
|
|
| |
Just so that this special-case is out of the common volume path.
|
| |
|
|
|
|
| |
For remote-debugging volume rstore problems.
|
| |
|
|
|
|
|
|
|
|
|
| |
Take advantage of the fact that list_devs is called with a
hotplug_inited ao. Also eliminate unnecessary nested function
abstraction of hotplug_(un)init and list_devs. However, keep list_devs
in ao_wasapi_utils.c since it uses the private functions get_device_id,
get_device_name and exposing these would require including headers for
IMMDevice in ao_wasapi_utils.h.
|