[MPlayer-dev-eng] [PATCH] Automatic downmix

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Sep 11 19:44:18 CEST 2010


On Sat, Sep 11, 2010 at 07:26:30PM +0200, Clément Bœsch wrote:
> On Sat, Sep 11, 2010 at 06:44:58PM +0200, Reimar Döffinger wrote:
> > On Sat, Sep 11, 2010 at 04:18:15PM +0200, Clément Bœsch wrote:
> > > @@ -1665,7 +1732,7 @@
> > >      if (!(initialized_flags & INITIALIZED_AO)) {
> > >          current_module="af_preinit";
> > >          ao_data.samplerate=force_srate;
> > > -        ao_data.channels=0;
> > > +        ao_data.channels=audio_output_channels;
> > 
> > Please test this very carefully, especially make sure that
> > all kinds of mono/stereo files still work with -channels 6.
> > I am for some reason quite convinced this was 0 for a good reason.
> 
> Oh you've right, sorry: If I play a stereo file, I get the sound in only
> right and left while the current behaviour gives output to the 6 physical
> channels with a stereo audio.
> 
> Well then I'm going to try something else, but if anyone has an idea how
> it could be fixed please share…

Use
ao_data.channels=-audio_output_channels;
as initial value.
The extend init_audio_filters to handle a negative channels values
as "at most this many channels".
For this, place your af_add code there.
No promise it will work, but I expect in init_audio_filters you
are most likely to have all the flexibility you need.


More information about the MPlayer-dev-eng mailing list