diff options
author | wm4 <wm4@nowhere> | 2016-08-04 20:49:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-04 20:49:20 +0200 |
commit | 0b144eac39bbae51c3f2b7683f6982eb91b66393 (patch) | |
tree | 63f0585f4dece4195da5745a4969159d9b5d8122 /audio/out/internal.h | |
parent | c30aa2340132e50994cdf168aaba011ecb4f6b0c (diff) | |
download | mpv-0b144eac39bbae51c3f2b7683f6982eb91b66393.tar.bz2 mpv-0b144eac39bbae51c3f2b7683f6982eb91b66393.tar.xz |
audio: use --audio-channels=auto behavior, except on ALSA
This commit adds an --audio-channel=auto-safe mode, and makes it the
default. This mode behaves like "auto" with most AOs, except with
ao_alsa. The intention is to allow multichannel output by default on
sane APIs. ALSA is not sane as in it's so low level that it will e.g.
configure any layout over HDMI, even if the connected A/V receiver does
not support it. The HDMI fuckup is of course not ALSA's fault, but other
audio APIs normally isolate applications from dealing with this and
require the user to globally configure the correct output layout.
This will help with other AOs too. ao_lavc (encoding) is changed to the
new semantics as well, because it used to force stereo (perhaps because
encoding mode is supposed to produce safe files for crap devices?).
Exclusive mode output on Windows might need to be adjusted accordingly,
as it grants the same kind of low level access as ALSA (requires more
research).
In addition to the things mentioned above, the --audio-channels option
is extended to accept a set of channel layouts. This is supposed to be
the correct way to configure mpv ALSA multichannel output. You need to
put a list of channel layouts that your A/V receiver supports.
Diffstat (limited to 'audio/out/internal.h')
-rw-r--r-- | audio/out/internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/out/internal.h b/audio/out/internal.h index 49131ba293..88160bbeb6 100644 --- a/audio/out/internal.h +++ b/audio/out/internal.h @@ -43,6 +43,7 @@ struct ao { struct encode_lavc_context *encode_lavc_ctx; struct input_ctx *input_ctx; struct mp_log *log; // Using e.g. "[ao/coreaudio]" as prefix + int init_flags; // AO_INIT_* flags // The device as selected by the user, usually using ao_device_desc.name // from an entry from the list returned by driver->list_devices. If the @@ -191,6 +192,8 @@ void ao_wakeup_poll(struct ao *ao); bool ao_chmap_sel_adjust(struct ao *ao, const struct mp_chmap_sel *s, struct mp_chmap *map); +bool ao_chmap_sel_adjust2(struct ao *ao, const struct mp_chmap_sel *s, + struct mp_chmap *map, bool safe_multichannel); bool ao_chmap_sel_get_def(struct ao *ao, const struct mp_chmap_sel *s, struct mp_chmap *map, int num); |