Skip to content

Commit

Permalink
ao_null: add --ao-null-format option for debugging
Browse files Browse the repository at this point in the history
Helpful especially to test spdif fallback and so on.
  • Loading branch information
wm4 authored and kevmitch committed Jan 30, 2018
1 parent 6d36fad commit 054c02a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions DOCS/man/ao.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions audio/out/ao_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct priv {
int outburst; // samples

struct m_channels channel_layouts;
int format;
};

static void drain(struct ao *ao)
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 054c02a

Please sign in to comment.