diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-30 00:20:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-07-01 01:05:06 +0100 |
| commit | 9b7e3d7d992f64da4bc78bc99d1eb706f181b798 (patch) | |
| tree | 24a9c3c9a9914e19454ca70d8e55c7f5e0746dc0 /src/lib/player.cc | |
| parent | 2894023433c3addfb04ba7ae0be534e251b641b9 (diff) | |
Make the preview respond to changes in subtitle line spacing.
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 0360858cb..e24baf3fa 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -181,6 +181,19 @@ Player::playlist_content_changed (weak_ptr<Content> w, int property, bool freque 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 || property == SubtitleContentProperty::X_OFFSET || @@ -775,3 +788,11 @@ Player::overlaps (DCPTime from, DCPTime to, boost::function<bool (Content *)> va return overlaps; } + +void +Player::reset_pieces () +{ + BOOST_FOREACH (shared_ptr<Piece> i, _pieces) { + i->decoder->reset (); + } +} |
