- DCPTime pos = range.second;
- for (int i = 0; i < n; ++i) {
- BOOST_FOREACH (shared_ptr<Content> j, c) {
- shared_ptr<Content> copy = j->clone ();
- copy->set_position (film, pos + copy->position() - range.first);
- _content.push_back (copy);
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+
+ DCPTime pos = range.second;
+ for (int i = 0; i < n; ++i) {
+ BOOST_FOREACH (shared_ptr<Content> j, c) {
+ shared_ptr<Content> copy = j->clone ();
+ copy->set_position (film, pos + copy->position() - range.first);
+ _content.push_back (copy);
+ }
+ pos += range.second - range.first;