diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-31 19:05:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-31 19:05:46 +0100 |
| commit | 9cbe46f9aa1d12b01ed0f9ffb3967bf6000e6e5c (patch) | |
| tree | d3c898472564220ebfe401ad4fb006c3f42d5126 /src/lib | |
| parent | d02f1b0f08b3095816767ab7a70254aef50eb355 (diff) | |
Time must be computed post-resample.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 8583a429b..ee044e4e1 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -216,7 +216,7 @@ Player::pass () audio_done_up_to = min (audio_done_up_to, (*i)->audio_position); } } - + TimedAudioBuffers<Time> tb = _audio_merger.pull (audio_done_up_to); Audio (tb.audio, tb.time); _audio_position += _film->audio_frames_to_time (tb.audio->frames ()); @@ -298,14 +298,6 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers shared_ptr<AudioContent> content = dynamic_pointer_cast<AudioContent> (piece->content); assert (content); - Time const relative_time = _film->audio_frames_to_time (frame); - - if (content->trimmed (relative_time)) { - return; - } - - Time time = content->position() + (content->audio_delay() * TIME_HZ / 1000) + relative_time; - /* Resample */ if (content->content_audio_frame_rate() != content->output_audio_frame_rate()) { shared_ptr<Resampler> r = resampler (content, true); @@ -314,6 +306,14 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers frame = ro.second; } + Time const relative_time = _film->audio_frames_to_time (frame); + + if (content->trimmed (relative_time)) { + return; + } + + Time time = content->position() + (content->audio_delay() * TIME_HZ / 1000) + relative_time; + /* Remap channels */ shared_ptr<AudioBuffers> dcp_mapped (new AudioBuffers (_film->audio_channels(), audio->frames())); dcp_mapped->make_silent (); |
