From 66c25e7a73fdc417d01d68b32a5e9eea8fca25dc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 18 Jun 2017 00:46:35 +0100 Subject: [PATCH] Remove spurious fills of audio data. With a 29.97 source I had problems because the earliest decoder position was one DCPTime quantum ahead of the last audio time; this looks like it was due to the content-to-DCP time conversion using 1.001 as the ratio for 30/29.97 rather than 1.001001; I haven't investigated why. This all needs more careful consideration... --- src/lib/player.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/player.cc b/src/lib/player.cc index 5c84ea5f5..82159df71 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -565,7 +565,7 @@ Player::pass () audio_fill_towards += DCPTime::from_seconds (earliest->content->audio->delay() / 1000.0); } - if (audio_fill_from && audio_fill_from < audio_fill_towards) { + if (audio_fill_from && audio_fill_from < audio_fill_towards && ((audio_fill_towards - *audio_fill_from) >= one_video_frame())) { DCPTimePeriod period (*audio_fill_from, audio_fill_towards); if (period.duration() > one_video_frame()) { period.to = period.from + one_video_frame(); @@ -919,7 +919,7 @@ void Player::emit_audio (shared_ptr data, DCPTime time) { Audio (data, time); - _last_audio_time = time + DCPTime::from_frames (data->frames(), _film->audio_frame_rate ()); + _last_audio_time = time + DCPTime::from_frames (data->frames(), _film->audio_frame_rate()); } void -- 2.30.2