Remove an old hack that is no longer necessary.
[dcpomatic.git] / src / lib / player.cc
index cf286f4a582fb0a4de592a6511ef347b8c0ae38f..27b2d8d977fc430ccbae9e9be64e10a47ed60ead 100644 (file)
@@ -710,10 +710,13 @@ Player::pass ()
                break;
        }
        case BLACK:
+       {
                LOG_DEBUG_PLAYER ("Emit black for gap at %1", to_string(_black.position()));
-               emit_video (black_player_video_frame(Eyes::BOTH), _black.position());
+               auto period = _black.period_at_position();
+               emit_video (black_player_video_frame(period.second), _black.position());
                _black.set_position (_black.position() + one_video_frame());
                break;
+       }
        case SILENT:
        {
                LOG_DEBUG_PLAYER ("Emit silence for gap at %1", to_string(_silent.position()));
@@ -813,19 +816,6 @@ Player::pass ()
                for (auto const& i: _delay) {
                        do_emit_video(i.first, i.second);
                }
-
-               /* Perhaps we should have Empty entries for both eyes in the 3D case (somehow).
-                * However, if we have L and R video files, and one is shorter than the other,
-                * the fill code in ::video mostly takes care of filling in the gaps.
-                * However, since it fills at the point when it knows there is more video coming
-                * at time t (so it should fill any gap up to t) it can't do anything right at the
-                * end.  This is particularly bad news if the last frame emitted is a LEFT
-                * eye, as the MXF writer will complain about the 3D sequence being wrong.
-                * Here's a hack to workaround that particular case.
-                */
-               if (_next_video_eyes && _next_video_time && *_next_video_eyes == Eyes::RIGHT) {
-                       do_emit_video (black_player_video_frame(Eyes::RIGHT), *_next_video_time);
-               }
        }
 
        return done;
@@ -1334,6 +1324,7 @@ Player::do_emit_video (shared_ptr<PlayerVideo> pv, DCPTime time)
                pv->set_text (subtitles.get ());
        }
 
+       LOG_DEBUG_PLAYER("Player --> Video %1 %2", to_string(time), static_cast<int>(pv->eyes()));
        Video (pv, time);
 }