1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00

ao_null: add --ao-null-format option for debugging

Helpful especially to test spdif fallback and so on.
This commit is contained in:
wm4 2018-01-29 06:08:52 +01:00 committed by Kevin Mitchell
parent 6d36fad83c
commit 054c02ad64
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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",