summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-29 06:08:52 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-30 03:10:27 -0800
commit054c02ad64a62dd8393bde0fd73edeaa71048722 (patch)
tree3feca6f347bec63e974fcea7536ae414c05a378d
parent6d36fad83c779936a012e85a1eb92ec94651c7c0 (diff)
downloadmpv-054c02ad64a62dd8393bde0fd73edeaa71048722.tar.bz2
mpv-054c02ad64a62dd8393bde0fd73edeaa71048722.tar.xz
ao_null: add --ao-null-format option for debugging
Helpful especially to test spdif fallback and so on.
-rw-r--r--DOCS/man/ao.rst3
-rw-r--r--audio/out/ao_null.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/DOCS/man/ao.rst b/DOCS/man/ao.rst
index f82263e134..b50cbc6b6b 100644
--- a/DOCS/man/ao.rst
+++ b/DOCS/man/ao.rst
@@ -198,6 +198,9 @@ Available audio output drivers are:
If not empty, this is a ``,`` separated list of channel layouts the
AO allows. This can be used to test channel layout selection.
+ ``--ao-null-format``
+ Force the audio output format the AO will accept. If unset accepts any.
+
``pcm``
Raw PCM/WAVE file writer audio output
diff --git a/audio/out/ao_null.c b/audio/out/ao_null.c
index 29d88d4670..3880ee8aa4 100644
--- a/audio/out/ao_null.c
+++ b/audio/out/ao_null.c
@@ -58,6 +58,7 @@ struct priv {
int outburst; // samples
struct m_channels channel_layouts;
+ int format;
};
static void drain(struct ao *ao)
@@ -88,6 +89,9 @@ static int init(struct ao *ao)
{
struct priv *priv = ao->priv;
+ if (priv->format)
+ ao->format = priv->format;
+
ao->untimed = priv->untimed;
struct mp_chmap_sel sel = {.tmp = ao};
@@ -241,6 +245,7 @@ const struct ao_driver audio_out_null = {
OPT_FLAG("broken-eof", broken_eof, 0),
OPT_FLAG("broken-delay", broken_delay, 0),
OPT_CHANNELS("channel-layouts", channel_layouts, 0),
+ OPT_AUDIOFORMAT("format", format, 0),
{0}
},
.options_prefix = "ao-null",