- assert (_encoder);
-
- AudioStream st = f->audio_stream().get();
-
- _matcher.reset (new Matcher (f->log(), st.sample_rate(), f->frames_per_second()));
- _delay_line.reset (new DelayLine (f->log(), st.channels(), f->audio_delay() * st.sample_rate() / 1000));
-
- /* Set up the decoder to use the film's set streams */
- _decoder->set_audio_stream (f->audio_stream ());
- _decoder->set_subtitle_stream (f->subtitle_stream ());
-
- _decoder->connect_video (_matcher);
- _matcher->connect_video (_encoder);
+ if (_playlist->has_audio ()) {
+ _matcher.reset (new Matcher (f->log(), _playlist->audio_frame_rate(), _playlist->video_frame_rate()));
+ _delay_line.reset (new DelayLine (f->log(), _playlist->audio_channels(), f->audio_delay() * _playlist->audio_frame_rate() / 1000));
+ _gain.reset (new Gain (f->log(), f->audio_gain()));
+ }