if (_film->audio_processor ()) {
_audio_processor = _film->audio_processor()->clone (_film->audio_frame_rate ());
}
+ } else if (p == Film::AUDIO_CHANNELS) {
+ _audio_merger.clear ();
}
}
continue;
}
- DCPTime const t = content_time_to_dcp (i, i->decoder->position());
+ /** decoder position may need to be trimmed like the
+ content (but the decoder does not know it yet);
+ check for that and fake it here if necessary.
+ */
+ DCPTime const t = content_time_to_dcp (i, min(i->decoder->position(), i->content->trim_start()));
if (t > i->content->end()) {
i->done = true;
} else {
PlayerSubtitles ps;
DCPTime const from (content_time_to_dcp (piece, subtitle.from()));
+ if (from > piece->content->end()) {
+ return;
+ }
+
BOOST_FOREACH (dcp::SubtitleString s, subtitle.subs) {
s.set_h_position (s.h_position() + piece->content->subtitle->x_offset ());
s.set_v_position (s.v_position() + piece->content->subtitle->y_offset ());
DCPTime const dcp_to = content_time_to_dcp (piece, to);
+ if (dcp_to > piece->content->end()) {
+ return;
+ }
+
pair<PlayerSubtitles, DCPTime> from = _active_subtitles.add_to (wp, dcp_to);
if (piece->content->subtitle->use() && !_always_burn_subtitles && !piece->content->subtitle->burn()) {
BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
if (time < i->content->position()) {
- /* Before; seek to 0 */
- i->decoder->seek (ContentTime(), accurate);
+ /* Before; seek to the start of the content */
+ i->decoder->seek (dcp_to_content_time (i, i->content->position()), accurate);
i->done = false;
} else if (i->content->position() <= time && time < i->content->end()) {
/* During; seek to position */
_film->log()->log(String::compose("Out-of-sequence emit %1 vs %2", to_string(time), to_string(*_last_audio_time)), LogEntry::TYPE_WARNING);
}
- /* This audio must follow on from the previous */
- DCPOMATIC_ASSERT (!_last_audio_time || time == *_last_audio_time);
+ /* This audio must follow on from the previous, but I'll remove this check for the 2.12.x release */
+ // DCPOMATIC_ASSERT (!_last_audio_time || time == *_last_audio_time);
Audio (data, time);
_last_audio_time = time + DCPTime::from_frames (data->frames(), _film->audio_frame_rate());
}