summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-30 22:19:43 +0200
committerwm4 <wm4@nowhere>2014-07-30 23:28:44 +0200
commit6afa1a2afc2ca5631d380477bc6d3e4ecc9865da (patch)
treee75f4883a8744342c7a9a3b8c2f0c56d188f9276 /audio
parentc3d15b50b498620b87951d6e89035bc4271ac38f (diff)
downloadmpv-6afa1a2afc2ca5631d380477bc6d3e4ecc9865da.tar.bz2
mpv-6afa1a2afc2ca5631d380477bc6d3e4ecc9865da.tar.xz
ao_alsa: disable use of non-interleaved formats by default
Some ALSA plugins take non-interleaved audio, but treat it as interleaved, which results in various funny bugs. Users keep hitting this issue, and it just doesn't seem worth the trouble. CC: @mpv-player/stable
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_alsa.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index cd46e52806..10580ffbff 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -63,6 +63,7 @@ struct priv {
char *cfg_mixer_name;
int cfg_mixer_index;
int cfg_resample;
+ int cfg_ni;
};
#define BUFFER_TIME 250000 // 250ms
@@ -352,6 +353,9 @@ static int init(struct ao *ao)
struct priv *p = ao->priv;
+ if (!p->cfg_ni)
+ ao->format = af_fmt_from_planar(ao->format);
+
/* switch for spdif
* sets opening sequence for SPDIF
* sets also the playback and other switches 'on the fly'
@@ -754,6 +758,7 @@ const struct ao_driver audio_out_alsa = {
.cfg_mixer_device = "default",
.cfg_mixer_name = "Master",
.cfg_mixer_index = 0,
+ .cfg_ni = 0,
},
.options = (const struct m_option[]) {
OPT_STRING("device", cfg_device, 0),
@@ -762,6 +767,7 @@ const struct ao_driver audio_out_alsa = {
OPT_STRING("mixer-device", cfg_mixer_device, 0),
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),
{0}
},
};