summaryrefslogtreecommitdiff
path: root/src/lib/playlist.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-15 16:36:49 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-15 16:36:49 +0100
commit1bb4bd728a445de0728c897211bf079c714d4f41 (patch)
treeb4d606dafac8a3fc99d8ce362238c0e14bc9459b /src/lib/playlist.cc
parent49c7639efbd0c7e014e9ddf3380b6d7f1fed9285 (diff)
Add some player tests. Fix seek with content at non-DCP frame rate. A few other small fixes.
Diffstat (limited to 'src/lib/playlist.cc')
-rw-r--r--src/lib/playlist.cc40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 703a14663..0d6462f6c 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 ();
+ }
- (*i)->set_start (last);
- last = (*i)->end ();
- }
+ ContentChanged (c, p);
+}
- _sequencing_video = false;
+void
+Playlist::maybe_sequence_video ()
+{
+ if (!_sequence_video || _sequencing_video) {
+ return;
}
- ContentChanged (c, p);
+ _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;
+ }
+
+ (*i)->set_start (last);
+ last = (*i)->end ();
+ }
+
+ _sequencing_video = false;
}
string