Commit 77e46ee5 authored by Thomas Guillem's avatar Thomas Guillem

aout: add Mono in "stereo-mode" option

Can be used to remix all input channels into one.
parent a6f6c341
......@@ -96,6 +96,7 @@
#define AOUT_VAR_CHAN_RIGHT 4
#define AOUT_VAR_CHAN_DOLBYS 5
#define AOUT_VAR_CHAN_HEADPHONES 6
#define AOUT_VAR_CHAN_MONO 7
/*****************************************************************************
* Main audio output structures
......
......@@ -415,6 +415,13 @@ static void aout_PrepareStereoMode (audio_output_t *aout,
if (!AOUT_FMT_LINEAR(fmt))
return;
if (i_nb_input_channels > 1)
{
val.i_int = AOUT_VAR_CHAN_MONO;
txt.psz_string = _("Mono");
var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);
}
if (i_nb_input_channels != 2)
{
val.i_int = AOUT_VAR_CHAN_UNSET;
......@@ -487,6 +494,11 @@ static void aout_PrepareStereoMode (audio_output_t *aout,
case AOUT_VAR_CHAN_HEADPHONES:
filters_cfg->headphones = true;
break;
case AOUT_VAR_CHAN_MONO:
/* Remix all channels into one */
for (size_t i = 0; i < AOUT_CHANIDX_MAX; ++ i)
filters_cfg->remap[i] = AOUT_CHANIDX_LEFT;
break;
default:
if (i_nb_input_channels == 2
&& fmt->i_chan_mode & AOUT_CHANMODE_DUALMONO)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment