audio = make_shared<AudioDecoder>(this, content->audio, fast);
}
for (auto i: content->text) {
- /* XXX: this time here should be the time of the first subtitle, not 0 */
- text.push_back (make_shared<TextDecoder>(this, i, ContentTime()));
+ text.push_back (make_shared<TextDecoder>(this, i));
+ /* We should really call maybe_set_position() on this TextDecoder to set the time
+ * of the first subtitle, but it probably doesn't matter since we'll always
+ * have regularly occurring video (and maybe audio) content.
+ */
}
if (content->atmos) {
atmos = make_shared<AtmosDecoder>(this, content);
true
);
- list<dcp::SubtitleString> strings;
+ vector<dcp::SubtitleString> strings;
for (auto i: subs) {
auto is = dynamic_pointer_cast<const dcp::SubtitleString>(i);
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.in().as_seconds()),
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
),
- strings
+ strings,
+ asset->subtitle_standard()
);
strings.clear ();
}
- strings.push_back (*is);
+ dcp::SubtitleString is_copy = *is;
+ is_copy.set_font(id_for_font_in_reel(is_copy.font().get_value_or(""), _reel - _reels.begin()));
+ strings.push_back(is_copy);
}
/* XXX: perhaps these image subs should also be collected together like the string ones are;
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.in().as_seconds()),
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
),
- strings
+ strings,
+ asset->subtitle_standard()
);
strings.clear ();
}
return;
}
- if ((*_reel)->main_picture()) {
+ DCPOMATIC_ASSERT(video);
+ if (!video->ignore() && (*_reel)->main_picture()) {
auto asset = (*_reel)->main_picture()->asset ();
auto mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (asset);
auto stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (asset);
_stereo_reader.reset ();
}
- if ((*_reel)->main_sound()) {
+ DCPOMATIC_ASSERT(audio);
+ if (!audio->ignore() && (*_reel)->main_sound()) {
_sound_reader = (*_reel)->main_sound()->asset()->start_read ();
_sound_reader->set_check_hmac (false);
} else {
return ContentTime::from_frames(_offset, _dcp_content->active_video_frame_rate(film())) + _next;
}
-
-vector<FontData>
-DCPDecoder::fonts () const
-{
- vector<FontData> data;
- for (auto i: _reels) {
- if (i->main_subtitle() && i->main_subtitle()->asset()) {
- for (auto const& j: i->main_subtitle()->asset()->font_data()) {
- data.push_back (FontData(j.first, j.second));
- }
- }
- }
- return data;
-}
-