• Rémi Denis-Courmont's avatar
    Spawn one audio output instance per audio input · 2b2af1eb
    Rémi Denis-Courmont authored
    When asked for more than one reference to an audio output instance, the
    input resource will now return distinct instances, instead of multiple
    references to a unique instance. This means each audio decoder will use
    an audio output of its own. Earlier, audio decoders from the same input
    would share their output through a mixer.
    
    In practice, this change does not make much difference. Indeed, there
    is normally only one active AUDIO_ES decoder_t/aout_input_t per input
    in any case. There is one quirk to render multiple audio tracks:
     # vlc --sout-all --sout '#display'
    
    There are a few advantages to this approach:
    
    - The output of each audio track can be controlled independently. For
    instance, different tracks can be routed to different devices,
    different ports, or in theory at least, to different output plugins.
    
    - This enables simplification of the audio output subsystem as it can
    now be assumed that there is only one (or zero) input per output.
    Track mixing is not required anymore. This is not to be confused with
    channel mixing!
    
    - We can get rid of the audio mixer plugins completely.
    
    There are also disadvantages. But there was no way to run into this
    situation with VLC, except for the --sout-all quirk as far as I know:
    
    - If the output does not support mixing internally, only one track can
    be rendered at a time. But any sane operating system supports mixing in
    hardware or software, so that more than one process can output audio.
    
    - The audio tracks might not be in perfect synchronization anymore.
    
    Note that the user interface does not support more than one output any
    better than the input (ES output) core. The input resource currently
    only keeps track of one audio output, but this could be fixed if
    needed. If you use PulseAudio, you can control the extrar outputs using
    an external PulseAudio mixer UI; I don't know about other systems.
    2b2af1eb
resource.c 14.7 KB