/** @return true if this decoder has already returned all its data and will give no more */
virtual bool pass (PassReason, bool accurate) = 0;
+
+ /** Ensure that any future get() calls return data that reflect
+ * changes in our content's settings.
+ */
+ virtual void reset () {}
};
#endif
_have_valid_pieces = false;
Changed (frequent);
+ } else if (
+ property == SubtitleContentProperty::LINE_SPACING
+ ) {
+
+ /* These changes just need the pieces' decoders to be reset.
+ It's quite possible that other changes could be handled by
+ this branch rather than the _have_valid_pieces = false branch
+ above. This would make things a lot faster.
+ */
+
+ reset_pieces ();
+ Changed (frequent);
+
} else if (
property == ContentProperty::VIDEO_FRAME_RATE ||
property == SubtitleContentProperty::USE ||
return overlaps;
}
+
+void
+Player::reset_pieces ()
+{
+ BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
+ i->decoder->reset ();
+ }
+}
friend struct player_time_calculation_test3;
void setup_pieces ();
+ void reset_pieces ();
void flush ();
void film_changed (Film::Property);
void playlist_changed ();
void
SubtitleDecoder::seek (ContentTime, bool)
+{
+ reset ();
+}
+
+void
+SubtitleDecoder::reset ()
{
_decoded_text.clear ();
_decoded_image.clear ();
std::list<ContentTextSubtitle> get_text (ContentTimePeriod period, bool starting, bool accurate);
void seek (ContentTime, bool);
+ void reset ();
void give_image (ContentTimePeriod period, boost::shared_ptr<Image>, dcpomatic::Rect<double>);
void give_text (ContentTimePeriod period, std::list<dcp::SubtitleString>);
}
private:
+
Decoder* _parent;
std::list<ContentImageSubtitle> _decoded_image;
std::list<ContentTextSubtitle> _decoded_text;
ContentTime::from_seconds (s.to.all_as_seconds())
);
}
+
+void
+TextSubtitleDecoder::reset ()
+{
+ subtitle->reset ();
+}
protected:
void seek (ContentTime time, bool accurate);
bool pass (PassReason, bool accurate);
+ void reset ();
private:
std::list<ContentTimePeriod> image_subtitles_during (ContentTimePeriod, bool starting) const;