summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-28 23:53:49 +0100
committerwm4 <wm4@nowhere>2015-03-28 23:53:49 +0100
commitb561ec99ff76d677182b71062e24a3cf40c35901 (patch)
tree91fbf18f9997f9513cd038d2c7636548613a131c /audio
parent36d1b2884955452676d9a01c0744f9ee1aeca6a1 (diff)
downloadmpv-b561ec99ff76d677182b71062e24a3cf40c35901.tar.bz2
mpv-b561ec99ff76d677182b71062e24a3cf40c35901.tar.xz
ao_alsa: add an option to ignore ALSA channel map negotiation
This was requested, more or less.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_alsa.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index dba6b19514..1ee662ac77 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -64,6 +64,7 @@ struct priv {
int cfg_mixer_index;
int cfg_resample;
int cfg_ni;
+ int cfg_ignore_chmap;
};
#define BUFFER_TIME 250000 // 250ms
@@ -478,7 +479,7 @@ static int init_device(struct ao *ao)
CHECK_ALSA_ERROR("Unable to set access type");
struct mp_chmap dev_chmap = ao->channels;
- if (AF_FORMAT_IS_IEC61937(ao->format)) {
+ if (AF_FORMAT_IS_IEC61937(ao->format) || p->cfg_ignore_chmap) {
dev_chmap.num = 0; // disable chmap API
} else if (query_chmaps(ao, &dev_chmap)) {
ao->channels = dev_chmap;
@@ -571,7 +572,9 @@ static int init_device(struct ao *ao)
MP_VERBOSE(ao, "which we understand as: %s\n", mp_chmap_to_str(&chmap));
- if (AF_FORMAT_IS_IEC61937(ao->format)) {
+ if (p->cfg_ignore_chmap) {
+ MP_VERBOSE(ao, "user set ignore-chmap; ignoring the channel map.\n");
+ } else if (AF_FORMAT_IS_IEC61937(ao->format)) {
MP_VERBOSE(ao, "using spdif passthrough; ignoring the channel map.\n");
} else if (mp_chmap_is_valid(&chmap)) {
if (mp_chmap_equals(&chmap, &ao->channels)) {
@@ -934,6 +937,7 @@ const struct ao_driver audio_out_alsa = {
OPT_STRING("mixer-name", cfg_mixer_name, 0),
OPT_INTRANGE("mixer-index", cfg_mixer_index, 0, 0, 99),
OPT_FLAG("non-interleaved", cfg_ni, 0),
+ OPT_FLAG("ignore-chmap", cfg_ignore_chmap, 0),
{0}
},
};