diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-14 23:38:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-14 23:38:45 +0100 |
| commit | a8b5ac47b89927eb2495dba71393a8a073967560 (patch) | |
| tree | a5b7c4462e55f2f6aec3627cac13c40ddd645578 /src/lib/playlist.cc | |
| parent | dad4da12a92ea74d340409140bb293441eed9e31 (diff) | |
Resequence video (perhaps) on DCP video frame rate change.
Diffstat (limited to 'src/lib/playlist.cc')
| -rw-r--r-- | src/lib/playlist.cc | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 9e7f7f5f5..aea6c5f41 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -72,25 +72,35 @@ Playlist::~Playlist () void Playlist::content_changed (weak_ptr<Content> c, int p) { - if (p == ContentProperty::LENGTH && _sequence_video && !_sequencing_video) { - _sequencing_video = true; - - ContentList cl = _content; - sort (cl.begin(), cl.end(), ContentSorter ()); - Time last = 0; - for (ContentList::iterator i = cl.begin(); i != cl.end(); ++i) { - if (!dynamic_pointer_cast<VideoContent> (*i)) { - continue; - } + if (p == ContentProperty::LENGTH) { + maybe_sequence_video (); + } + + ContentChanged (c, p); +} - (*i)->set_start (last); - last = (*i)->end (); +void +Playlist::maybe_sequence_video () +{ + if (!_sequence_video || _sequencing_video) { + return; + } + + _sequencing_video = true; + + ContentList cl = _content; + sort (cl.begin(), cl.end(), ContentSorter ()); + Time last = 0; + for (ContentList::iterator i = cl.begin(); i != cl.end(); ++i) { + if (!dynamic_pointer_cast<VideoContent> (*i)) { + continue; } - - _sequencing_video = false; + + (*i)->set_start (last); + last = (*i)->end (); } - ContentChanged (c, p); + _sequencing_video = false; } string |
