diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-09-21 23:29:35 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-21 23:29:35 +0200 |
| commit | 0717e1ca56bbf5334d56e45940ebdaba05506986 (patch) | |
| tree | a177d073b0e0a3d4919cb2c35b692c183d9d3eab /src/lib/player.cc | |
| parent | 56062db51268e35bb65e1584d8e0b45fffae65dd (diff) | |
Hackshigher-hz
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 77916a5e5..82aadd802 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -889,9 +889,15 @@ Player::pass() if (done) { if (_next_video_time) { LOG_DEBUG_PLAYER("Done: emit video until end of film at {}", film->length().to_string()); + std::cout << "Emit until end of film at " << film->length().to_string() << " " << film->length().frames_round(72) << "\n"; emit_video_until(film->length()); } + std::cout << "done: nat " << _next_audio_time.get_value_or({}).to_string() << " film " << film->length().to_string() << "\n"; + if (_next_audio_time && film->length() > *_next_audio_time) { + fill_audio(DCPTimePeriod(*_next_audio_time, film->length())); + } + if (_shuffler) { _shuffler->flush(); } @@ -965,7 +971,8 @@ void Player::emit_video_until(DCPTime time) { LOG_DEBUG_PLAYER("emit_video_until {}; next video time is {}", time.to_string(), _next_video_time.get_value_or({}).to_string()); - auto frame = [this](shared_ptr<PlayerVideo> pv, DCPTime time) { + static int shite = 0; + auto frame = [this, &shite](shared_ptr<PlayerVideo> pv, DCPTime time) { /* We need a delay to give a little wiggle room to ensure that relevant subtitles arrive at the player before the video that requires them. */ @@ -982,6 +989,7 @@ Player::emit_video_until(DCPTime time) auto to_do = _delay.front(); _delay.pop_front(); emit_video(to_do.first, to_do.second); + std::cout << "EV " << to_do.second.to_string() << " " << ++shite << "\n"; }; auto film = _film.lock(); @@ -995,6 +1003,8 @@ Player::emit_video_until(DCPTime time) } }; + std::cout << "EVU " << _next_video_time.get_value_or({}).to_string() << " " << time.to_string() << "\n"; + while (_next_video_time.get_value_or({}) < time) { auto left = _last_video[Eyes::LEFT]; auto right = _last_video[Eyes::RIGHT]; @@ -1458,6 +1468,7 @@ Player::emit_video(shared_ptr<PlayerVideo> pv, DCPTime time) pv->set_text(texts.get()); } + // std::cout << "emit_video " << time.to_string() << "\n"; Video(pv, time); } @@ -1477,6 +1488,9 @@ Player::emit_audio(shared_ptr<AudioBuffers> data, DCPTime time) /* This audio must follow on from the previous, allowing for half a sample (at 48kHz) leeway */ DCPOMATIC_ASSERT(diff < 2); Audio(data, time, film->audio_frame_rate()); + static int64_t x = 0; + x += data->frames(); + std::cout << "sent " << x << " audio frames.\n"; _next_audio_time = time + DCPTime::from_frames(data->frames(), film->audio_frame_rate()); } |
