diff options
author | wm4 <wm4@nowhere> | 2014-07-30 22:19:43 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-30 23:28:44 +0200 |
commit | 6afa1a2afc2ca5631d380477bc6d3e4ecc9865da (patch) | |
tree | e75f4883a8744342c7a9a3b8c2f0c56d188f9276 | |
parent | c3d15b50b498620b87951d6e89035bc4271ac38f (diff) | |
download | mpv-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
-rw-r--r-- | DOCS/man/ao.rst | 4 | ||||
-rw-r--r-- | audio/out/ao_alsa.c | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/DOCS/man/ao.rst b/DOCS/man/ao.rst index 186512c7a5..5bd82cd9f4 100644 --- a/DOCS/man/ao.rst +++ b/DOCS/man/ao.rst @@ -53,6 +53,10 @@ Available audio output drivers are: Set the index of the mixer channel (default: 0). Consider the output of "``amixer scontrols``", then the index is the number that follows the name of the element. + ``non-interleaved`` + Allow output of non-interleaved formats (if the audio decoder uses + this format). Currently disabled by default, because some popular + ALSA plugins are utterly broken with non-interleaved formats. .. note:: 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} }, }; |