assert (_encoder);
if (f->audio_stream()) {
- 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));
+ shared_ptr<AudioStream> st = f->audio_stream();
+ _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));
_gain.reset (new Gain (f->log(), f->audio_gain()));
}
}
} catch (...) {
- /* process_end() is important as the decoder may have worker
- threads that need to be cleaned up.
- */
_encoder->process_end ();
throw;
}
-
+
+ if (_delay_line) {
+ _delay_line->process_end ();
+ }
+ if (_matcher) {
+ _matcher->process_end ();
+ }
+ if (_gain) {
+ _gain->process_end ();
+ }
_encoder->process_end ();
}