summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-14 23:38:45 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-14 23:38:45 +0100
commita8b5ac47b89927eb2495dba71393a8a073967560 (patch)
treea5b7c4462e55f2f6aec3627cac13c40ddd645578 /src/lib
parentdad4da12a92ea74d340409140bb293441eed9e31 (diff)
Resequence video (perhaps) on DCP video frame rate change.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc3
-rw-r--r--src/lib/playlist.cc40
-rw-r--r--src/lib/playlist.h1
3 files changed, 29 insertions, 15 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index f306006c9..295f80ccb 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -632,6 +632,9 @@ Film::signal_changed (Property p)
case Film::CONTENT:
set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ());
break;
+ case Film::DCP_VIDEO_FRAME_RATE:
+ _playlist->maybe_sequence_video ();
+ break;
default:
break;
}
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
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index cf0f09b31..805df4d70 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -86,6 +86,7 @@ public:
Time video_end () const;
void set_sequence_video (bool);
+ void maybe_sequence_video ();
mutable boost::signals2::signal<void ()> Changed;
mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int)> ContentChanged;