summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_content.cc1
-rw-r--r--src/lib/film.cc1
-rw-r--r--src/lib/j2k_encoder.cc2
-rw-r--r--src/lib/player.cc16
-rw-r--r--src/lib/reel_writer.cc4
-rw-r--r--src/lib/writer.cc1
6 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 6d70336a5..cb4b6199b 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -412,6 +412,7 @@ FFmpegContent::full_length (shared_ptr<const Film> film) const
{
FrameRateChange const frc (film, shared_from_this());
if (video) {
+ // std::cout << "video is " << video->length_after_3d_combine() << " frames, factor=" << frc.factor() << " out " << film->video_frame_rate() << "\n";
return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
}
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 754c7c850..1d062fb09 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1985,6 +1985,7 @@ Film::reels_for_type(ReelType type) const
switch (type) {
case ReelType::SINGLE:
+ std::cout << "reels end " << len.to_string() << "\n";
periods.emplace_back(DCPTime(), len);
break;
case ReelType::BY_VIDEO_CONTENT:
diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc
index 2d7802068..c04336586 100644
--- a/src/lib/j2k_encoder.cc
+++ b/src/lib/j2k_encoder.cc
@@ -322,9 +322,11 @@ J2KEncoder::encode (shared_ptr<PlayerVideo> pv, DCPTime time)
frame_done ();
} else if (_last_player_video[pv->eyes()] && _writer.can_repeat(position) && pv->same(_last_player_video[pv->eyes()])) {
LOG_DEBUG_ENCODE("Frame @ {} REPEAT", time.to_string());
+ std::cout << "Frame @ " << time.to_string() << " " << time.frames_round(72) << " REPEAT\n";
_writer.repeat(position, pv->eyes());
} else {
LOG_DEBUG_ENCODE("Frame @ {} ENCODE", time.to_string());
+ std::cout << "Frame @ " << time.to_string() << " " << time.frames_round(72) << " ENCODE\n";
/* Queue this new frame for encoding */
LOG_TIMING ("add-frame-to-queue queue={}", _queue.size ());
auto dcpv = DCPVideo(
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());
}
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index d78c6b730..465b84528 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -345,9 +345,11 @@ ReelWriter::repeat_write(Frame frame, Eyes eyes)
{
if (!_j2k_picture_asset_writer) {
/* We're not writing any data */
+ std::cout << "don't do it.\n";
return;
}
+ std::cout << "do it.\n";
auto fin = J2KFrameInfo(_j2k_picture_asset_writer->write(_last_written[eyes]->data(), _last_written[eyes]->size()));
fin.write(_info_file, frame, eyes);
}
@@ -580,7 +582,7 @@ ReelWriter::create_reel_sound(shared_ptr<dcp::Reel> reel, list<ReferencedReelAss
if (reel_asset->actual_duration() != period_duration) {
throw ProgrammingError(
__FILE__, __LINE__,
- fmt::format("{} vs {}", reel_asset->actual_duration(), period_duration)
+ fmt::format("sound asset {} vs reel {}", reel_asset->actual_duration(), period_duration)
);
}
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index dd5223670..2c1da13d1 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -448,6 +448,7 @@ try
break;
case QueueItem::Type::REPEAT:
LOG_DEBUG_ENCODE(N_("Writer REPEAT-writes {}"), qi.frame);
+ std::cout << "Writer REPEAT-writes " << qi.frame << "\n";
reel.repeat_write(qi.frame, qi.eyes);
++_repeat_written;
break;