if (_resampler) {
data = _resampler->run (data);
}
-
+
_pending.push_back (shared_ptr<DecodedAudio> (new DecodedAudio (data, _audio_position)));
_audio_position += data->frames ();
}
assert (film);
FrameRateChange frc = film->active_frame_rate_change (_audio_content->position ());
- _audio_position = (t + first_audio()) / frc.speed_up;
+ _audio_position = ((t + first_audio()) / frc.speed_up) * film->audio_frame_rate() / TIME_HZ;
}
dec->set_dcp_times (_film->video_frame_rate(), _film->audio_frame_rate(), (*i)->frc, offset);
DCPTime const t = dec->dcp_time - offset;
- if (t >= (*i)->content->full_length() - (*i)->content->trim_end ()) {
+ if (t >= ((*i)->content->full_length() - (*i)->content->trim_end ())) {
/* In the end-trimmed part; decoder has nothing else to give us */
dec.reset ();
done = true;