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

Clément Bœsch ubitux at gmail.com
Thu Sep 23 14:56:56 CEST 2010


On Sun, Sep 19, 2010 at 05:28:23PM +0200, Nicolas George wrote:
> Le jour du Labour, an CCXVIII, Clément Bœsch a écrit :
> > So yes, there is a final downmix filter added (and this is the same
> > without -channels 2 since it's the default).
> > 
> > However, if you set -channels 6, then only the pan filter for upmix
> > (specified in command line) is added.
> 
> Yes, but this is not the only consequence of -channels 6, it also affects
> the way some codec do their work.
> 
> For example, you could imagine a strange AC3 file that crashes the decoders
> with -channels 6 or just plays horribly, but works fine with -channels 2. Of
> course, you would file a bug report, but in the meantime, you may want to
> play the file on a 5.1 speaker system, thus the af pan=6.
> 
> I concede that this scenario is quite unlikely, but it is not strictly
> impossible, and the principle it illustrates stands: once in a while, some
> user will have a good reason to combine -channels 2 and -af pan=6.
> 
> The cornerstone is, I believe, the meaning of the -channels option.
> Currently, it is "have the codec try to decode to n channels if it can". The
> current version of your patch changes it to "have the codec try to decode to
> n channels if it can, and force the audio to n channels before outout", and
> I do not think this is right, since those are two very different features.
> 
> The change should IMHO rather be: "have the codec decode to n channels by
> any means necessary". That would probably mean add a pan filter just after
> the codec, at the very start of the filter chain. And probably doing it just
> after the codec is initialized.
> 

Even before the format filter? If I prepend the filter (starting at
s->first), it will be forced after the format filter. Should I change this
behavior?

Here is what I have with af_prepend(s, s->first, af_pan_str):

Normal downmix case (Flac 5.1, no options):

  Before downmix, filter list is:
    [dummy]
  After downmix + reinit, filter list is:
    [format] → [pan] → [dummy]

And with -channels 2 -af pan=6:...:

   Before downmix, filter list is:
     [format] → [pan (upmix 6 chan)]
   After downmix + reinit, filter list is:
     [format] → [pan (downmix 2 chan)] → [pan (upmix 6 chan)]

Is this what you would like? Or as I said, forced before the format filter?

Regards,

-- 
Clément B.


More information about the MPlayer-dev-eng mailing list