+ /* We need a delay to give a little wiggle room to ensure that relevent subtitles arrive at the
+ player before the video that requires them.
+ */
+ _delay.push_back (make_pair (pv, time));
+
+ if (pv->eyes() == EYES_BOTH || pv->eyes() == EYES_RIGHT) {
+ _last_video_time = time + one_video_frame();
+ }
+ _last_video_eyes = increment_eyes (pv->eyes());
+
+ if (_delay.size() < 3) {
+ return;
+ }
+
+ pair<shared_ptr<PlayerVideo>, DCPTime> to_do = _delay.front();
+ _delay.pop_front();
+ do_emit_video (to_do.first, to_do.second);
+}
+
+void
+Player::do_emit_video (shared_ptr<PlayerVideo> pv, DCPTime time)
+{
+ if (pv->eyes() == EYES_BOTH || pv->eyes() == EYES_RIGHT) {
+ for (int i = 0; i < TEXT_COUNT; ++i) {
+ _active_text[i].clear_before (time);
+ }
+ }
+