projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
15f8567
)
Remove unused Film::content_paths_valid; fix ImageDecoder to throw an OpenFileError...
author
Carl Hetherington
<cth@carlh.net>
Sat, 28 Dec 2013 15:00:38 +0000
(15:00 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Sat, 28 Dec 2013 15:00:38 +0000
(15:00 +0000)
ChangeLog
patch
|
blob
|
history
src/lib/content.cc
patch
|
blob
|
history
src/lib/content.h
patch
|
blob
|
history
src/lib/film.cc
patch
|
blob
|
history
src/lib/film.h
patch
|
blob
|
history
src/lib/image_decoder.cc
patch
|
blob
|
history
src/lib/playlist.cc
patch
|
blob
|
history
src/lib/playlist.h
patch
|
blob
|
history
src/wx/content_menu.cc
patch
|
blob
|
history
src/wx/film_editor.cc
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 7feabc198f4db34f172bbb9c175ffeeeaf04bafb..c80ad2e6342806b13609daee421b9b6153f7667c 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,7
@@
+2013-12-28 Carl Hetherington <cth@carlh.net>
+
+ * Fix failure to load films with missing still image content (#300).
+
2013-12-27 Carl Hetherington <cth@carlh.net>
* Fix non-update of video information on changing DCP resolution (#299).
2013-12-27 Carl Hetherington <cth@carlh.net>
* Fix non-update of video information on changing DCP resolution (#299).
diff --git
a/src/lib/content.cc
b/src/lib/content.cc
index f09012765a7cbe7616d1e2ae40a870981b74604a..d835a5b0573fd263c6e46f0be4073d830bccde06 100644
(file)
--- a/
src/lib/content.cc
+++ b/
src/lib/content.cc
@@
-232,7
+232,7
@@
Content::identifier () const
}
bool
}
bool
-Content::path_valid () const
+Content::path
s
_valid () const
{
for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
if (!boost::filesystem::exists (*i)) {
{
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 9cf6d866ab04906b3288188792c66f9403b8592e..4ee7c267f354c5cf65da2f1c948f3b8d93b79424 100644
(file)
--- a/
src/lib/content.h
+++ b/
src/lib/content.h
@@
-84,7
+84,7
@@
public:
return _paths[i];
}
return _paths[i];
}
- bool path_valid () const;
+ bool path
s
_valid () const;
/** @return MD5 digest of the content's file(s) */
std::string digest () 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 5946d5bec8ce3db40f8c53d06259ae521f8dd170..1bf35cc5fffde98ced3c2a2598c0a41926f129c4 100644
(file)
--- 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 ();
}
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)
{
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 4b07f84a928503befb9fd231ab2f4a0a8efd97e9..e318f772492fc83777b5169170ff822779c88c08 100644
(file)
--- 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;
Time length () const;
bool has_subtitles () const;
OutputVideoFrame best_video_frame_rate () const;
- bool content_paths_valid () const;
libdcp::KDM
make_kdm (
libdcp::KDM
make_kdm (
diff --git
a/src/lib/image_decoder.cc
b/src/lib/image_decoder.cc
index fb6053ae5226188d91f31809133df65aec47d011..a7999c02a86b5270b09dd50fd118c00280ef5761 100644
(file)
--- a/
src/lib/image_decoder.cc
+++ b/
src/lib/image_decoder.cc
@@
-52,7
+52,14
@@
ImageDecoder::pass ()
return;
}
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));
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 37b2902189f2b32d61a94a57bbc0baa36c7f0a28..daa82cb94a56e305dc3420424f15e2d7a4f1cf41 100644
(file)
--- a/
src/lib/playlist.cc
+++ b/
src/lib/playlist.cc
@@
-389,15
+389,3
@@
Playlist::move_later (shared_ptr<Content> c)
Changed ();
}
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 f87b3397b4b68e388f3f5e0f37b512c385c4bcf5..1915e3d045a01cabe7058c0fb4af089599548842 100644
(file)
--- a/
src/lib/playlist.h
+++ b/
src/lib/playlist.h
@@
-80,8
+80,6
@@
public:
void repeat (ContentList, int);
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;
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 254109eb3c882083c52193abf816d8b04d8c871b..6372503d14db465069eb62b16ff010ad49dac0b8 100644
(file)
--- 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);
_join->Enable (n > 1);
- _find_missing->Enable (_content.size() == 1 && !_content.front()->path_valid ());
+ _find_missing->Enable (_content.size() == 1 && !_content.front()->path
s
_valid ());
_remove->Enable (!_content.empty ());
_parent->PopupMenu (_menu, p);
}
_remove->Enable (!_content.empty ());
_parent->PopupMenu (_menu, p);
}
diff --git
a/src/wx/film_editor.cc
b/src/wx/film_editor.cc
index e478734c7149dbcdba326ba42be3cc44bea3599b..04bf6d2a809c10334b4a2b13b165d67fe6d52e2b 100644
(file)
--- 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 ();
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)->path
s
_valid ();
string s = (*i)->summary ();
if (!valid) {
string s = (*i)->summary ();
if (!valid) {