diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-29 10:17:50 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-01-28 02:01:56 +0100 |
| commit | 895143459866dcb373c93b8e674d1344a129a6df (patch) | |
| tree | 1d63b4307bad010c670e23bd37bb9f91e6f67f36 /test/shuffler_test.cc | |
| parent | c0bc376cc04f36c92f7a136e405e4cb1ea16cf99 (diff) | |
Change how video timing is done.
This commit changes the approach with video timing. Previously,
we would (more-or-less) try to use every video frame from the content
in the output, hoping that they come at a constant frame rate.
This is not always the case, however. Here we preserve the PTS
of video frames, and then when one arrives we output whatever
DCP video frames we can (at the regular DCP frame rate).
Hopefully this will solve a range of sync problems, but it
could also introduce new ones.
Diffstat (limited to 'test/shuffler_test.cc')
| -rw-r--r-- | test/shuffler_test.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/shuffler_test.cc b/test/shuffler_test.cc index 2099a0923..37d6749c3 100644 --- a/test/shuffler_test.cc +++ b/test/shuffler_test.cc @@ -33,14 +33,15 @@ using boost::optional; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif +using namespace dcpomatic; static void -push (Shuffler& s, int frame, Eyes eyes) +push(Shuffler& s, int frame, Eyes eyes) { auto piece = make_shared<Piece>(shared_ptr<Content>(), shared_ptr<Decoder>(), FrameRateChange(24, 24)); ContentVideo cv; - cv.frame = frame; + cv.time = ContentTime::from_frames(frame, 24); cv.eyes = eyes; s.video (piece, cv); } @@ -56,8 +57,9 @@ receive (weak_ptr<Piece>, ContentVideo cv) static void check (int frame, Eyes eyes, int line) { + auto const time = ContentTime::from_frames(frame, 24); BOOST_REQUIRE_MESSAGE (!pending_cv.empty(), "Check at " << line << " failed."); - BOOST_CHECK_MESSAGE (pending_cv.front().frame == frame, "Check at " << line << " failed."); + BOOST_CHECK_MESSAGE (pending_cv.front().time == time, "Check at " << line << " failed."); BOOST_CHECK_MESSAGE (pending_cv.front().eyes == eyes, "Check at " << line << " failed."); pending_cv.pop_front(); } |
