- if (f->has_audio ()) {
- _matcher.reset (new Matcher (f->log(), f->audio_frame_rate(), f->video_frame_rate()));
- _delay_line.reset (new DelayLine (f->log(), f->audio_channels(), f->audio_delay() * f->audio_frame_rate() / 1000));
- _gain.reset (new Gain (f->log(), f->audio_gain()));
- }
-
- if (!f->with_subtitles ()) {
- _player->disable_subtitles ();
- }
-
- if (_matcher) {
- _player->connect_video (_matcher);
- _matcher->connect_video (_encoder);
- } else {
- _player->connect_video (_encoder);
- }
-
- if (_matcher && _delay_line && f->has_audio ()) {
- _player->connect_audio (_delay_line);
- _delay_line->connect_audio (_matcher);
- _matcher->connect_audio (_gain);
- _gain->connect_audio (_encoder);
- }
+ _player->Video.connect (bind (video_proxy, _encoder, _1, _2));
+ _player->Audio.connect (bind (audio_proxy, _encoder, _1));