diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-28 15:00:38 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-28 15:00:38 +0000 |
| commit | af3e8ed8382cdc35e361cdca1f735a379fce1317 (patch) | |
| tree | f8d205c6049251dd0d9db90ef78c146a0c101112 /src/lib | |
| parent | 15f8567ed4e9aad1f12d3242a090a0f44e24932f (diff) | |
Remove unused Film::content_paths_valid; fix ImageDecoder to throw an OpenFileError when a file is missing so that it gets treated as missing content; rename Content::path_valid -> paths_valid.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/content.cc | 2 | ||||
| -rw-r--r-- | src/lib/content.h | 2 | ||||
| -rw-r--r-- | src/lib/film.cc | 6 | ||||
| -rw-r--r-- | src/lib/film.h | 1 | ||||
| -rw-r--r-- | src/lib/image_decoder.cc | 9 | ||||
| -rw-r--r-- | src/lib/playlist.cc | 12 | ||||
| -rw-r--r-- | src/lib/playlist.h | 2 |
7 files changed, 10 insertions, 24 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index f09012765..d835a5b05 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 9cf6d866a..4ee7c267f 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 5946d5bec..1bf35cc5f 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 (); -} - void Film::playlist_content_changed (boost::weak_ptr<Content> c, int p) { diff --git a/src/lib/film.h b/src/lib/film.h index 4b07f84a9..e318f7724 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -114,7 +114,6 @@ public: Time length () const; bool has_subtitles () const; OutputVideoFrame best_video_frame_rate () const; - bool content_paths_valid () const; libdcp::KDM make_kdm ( diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index fb6053ae5..a7999c02a 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -52,7 +52,14 @@ ImageDecoder::pass () return; } - 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 37b290218..daa82cb94 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -389,15 +389,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 f87b3397b..1915e3d04 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -80,8 +80,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; |
