summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-28 15:09:30 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-28 15:09:30 +0000
commit521c09170d9e62cd72cc2da66c41816761008a4b (patch)
tree267f5cb83ba72a1d489f32ba3c94d5ac02579a4e /src
parent0987c41ac468fd93bbb444093e66d5d6753cb927 (diff)
parentaf3e8ed8382cdc35e361cdca1f735a379fce1317 (diff)
Merge 1.0
Diffstat (limited to 'src')
-rw-r--r--src/lib/content.cc2
-rw-r--r--src/lib/content.h2
-rw-r--r--src/lib/film.cc6
-rw-r--r--src/lib/film.h1
-rw-r--r--src/lib/image_decoder.cc9
-rw-r--r--src/lib/playlist.cc12
-rw-r--r--src/lib/playlist.h2
-rw-r--r--src/wx/content_menu.cc2
-rw-r--r--src/wx/film_editor.cc2
9 files changed, 12 insertions, 26 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 7db349617..fa0031abf 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -232,7 +232,7 @@ Content::identifier () const
}
bool
-Content::path_valid () const
+Content::paths_valid () const
{
for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
if (!boost::filesystem::exists (*i)) {
diff --git a/src/lib/content.h b/src/lib/content.h
index 1eee02e01..965b33b22 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -84,7 +84,7 @@ public:
return _paths[i];
}
- bool path_valid () const;
+ bool paths_valid () const;
/** @return MD5 digest of the content's file(s) */
std::string digest () const {
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 8e93667d5..98b7bf6b9 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -860,12 +860,6 @@ Film::best_video_frame_rate () const
return _playlist->best_dcp_frame_rate ();
}
-bool
-Film::content_paths_valid () const
-{
- return _playlist->content_paths_valid ();
-}
-
FrameRateChange
Film::active_frame_rate_change (DCPTime t) const
{
diff --git a/src/lib/film.h b/src/lib/film.h
index a0ace9981..f1564e83b 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -114,7 +114,6 @@ public:
DCPTime length () const;
bool has_subtitles () const;
OutputVideoFrame best_video_frame_rate () const;
- bool content_paths_valid () const;
FrameRateChange active_frame_rate_change (DCPTime) const;
libdcp::KDM
diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc
index 9e90b5bc8..a5ca67e0d 100644
--- a/src/lib/image_decoder.cc
+++ b/src/lib/image_decoder.cc
@@ -54,7 +54,14 @@ ImageDecoder::pass ()
return false;
}
- Magick::Image* magick_image = new Magick::Image (_image_content->path (_image_content->still() ? 0 : _video_position).string ());
+ Magick::Image* magick_image = 0;
+ boost::filesystem::path const path = _image_content->path (_image_content->still() ? 0 : _video_position);
+ try {
+ magick_image = new Magick::Image (path.string ());
+ } catch (...) {
+ throw OpenFileError (path);
+ }
+
libdcp::Size size (magick_image->columns(), magick_image->rows());
_image.reset (new Image (PIX_FMT_RGB24, size, true));
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 9fc62f8be..4175de4c9 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -406,15 +406,3 @@ Playlist::move_later (shared_ptr<Content> c)
Changed ();
}
-
-bool
-Playlist::content_paths_valid () const
-{
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- if (!(*i)->path_valid ()) {
- return false;
- }
- }
-
- return true;
-}
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index a985bf93d..35709f109 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -82,8 +82,6 @@ public:
void repeat (ContentList, int);
- bool content_paths_valid () const;
-
mutable boost::signals2::signal<void ()> Changed;
/** Third parameter is true if signals are currently being emitted frequently */
mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> ContentChanged;
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 254109eb3..6372503d1 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -80,7 +80,7 @@ ContentMenu::popup (ContentList c, wxPoint p)
_join->Enable (n > 1);
- _find_missing->Enable (_content.size() == 1 && !_content.front()->path_valid ());
+ _find_missing->Enable (_content.size() == 1 && !_content.front()->paths_valid ());
_remove->Enable (!_content.empty ());
_parent->PopupMenu (_menu, p);
}
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 1b3903929..1818fb451 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -734,7 +734,7 @@ FilmEditor::setup_content ()
ContentList content = _film->content ();
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
int const t = _content->GetItemCount ();
- bool const valid = (*i)->path_valid ();
+ bool const valid = (*i)->paths_valid ();
string s = (*i)->summary ();
if (!valid) {