- /* Set up the decoder to use the film's set streams */
- _decoders.first->set_subtitle_stream (f->subtitle_stream ());
- _decoders.second->set_audio_stream (f->audio_stream ());
-
- if (_matcher) {
- _decoders.first->connect_video (_matcher);
- _matcher->connect_video (_encoder);
- } else {
- _decoders.first->connect_video (_encoder);
- }
-
- if (_matcher && _delay_line) {
- _decoders.second->connect_audio (_delay_line);
- _delay_line->connect_audio (_matcher);
- _matcher->connect_audio (_gain);
- _gain->connect_audio (_encoder);
+static void
+audio_proxy (weak_ptr<Encoder> encoder, shared_ptr<const AudioBuffers> audio)
+{
+ shared_ptr<Encoder> e = encoder.lock ();
+ if (e) {
+ e->process_audio (audio);