summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-06-18 00:46:35 +0100
committerCarl Hetherington <cth@carlh.net>2017-06-18 00:46:35 +0100
commit66c25e7a73fdc417d01d68b32a5e9eea8fca25dc (patch)
treec922f32fa023803f95397d23a27889adcecbdec0 /src
parent450b235d586b862ecd61a0a41b4125fffe8a86c1 (diff)
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...
Diffstat (limited to 'src')
-rw-r--r--src/lib/player.cc4
1 files 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<AudioBuffers> 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