From 054c02ad64a62dd8393bde0fd73edeaa71048722 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 29 Jan 2018 06:08:52 +0100 Subject: ao_null: add --ao-null-format option for debugging Helpful especially to test spdif fallback and so on. --- DOCS/man/ao.rst | 3 +++ audio/out/ao_null.c | 5 +++++ 2 files changed, 8 insertions(+) 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", -- cgit v1.2.3