X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=9064627ba9cd937a4930631e17f4665837553ee6;hb=ff639b3cf30afcc097bfd21d39c8d15f466cadd6;hp=dfbef340601df21687144754d354e4539b33f1e6;hpb=2975fa5cd5dcfaa806b07ef39c8900e07f417658;p=dcpomatic.git diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index dfbef3406..9064627ba 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -80,8 +80,11 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptr(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(this, i, ContentTime())); + text.push_back (make_shared(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(this, content); @@ -300,12 +303,15 @@ DCPDecoder::pass_texts ( 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, + _dcp_content->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; @@ -333,7 +339,8 @@ DCPDecoder::pass_texts ( 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, + _dcp_content->standard() ); strings.clear (); } @@ -502,18 +509,3 @@ DCPDecoder::position () const return ContentTime::from_frames(_offset, _dcp_content->active_video_frame_rate(film())) + _next; } - -vector -DCPDecoder::fonts () const -{ - vector 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; -} -