From 6afa1a2afc2ca5631d380477bc6d3e4ecc9865da Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Jul 2014 22:19:43 +0200 Subject: 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 --- audio/out/ao_alsa.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'audio') 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} }, }; -- cgit v1.2.3