diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-02-28 00:13:54 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-02-28 00:14:06 +0000 |
| commit | bb997ae750c545f959fd76c8421a5bbf7fe1ad36 (patch) | |
| tree | 034724f3b8da6e740bb9e76493245ca045a8a6d6 /src/lib | |
| parent | 3057189c6f30f822c0e8835a1257c1b94fce01df (diff) | |
Fix crash if quick_refresh() fails.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player_video.cc | 13 | ||||
| -rw-r--r-- | src/lib/player_video.h | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index c24f9ccaa..8eb39efed 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -286,17 +286,22 @@ PlayerVideo::shallow_copy () const ); } -/** Re-read crop, fade, inter/out size and colour conversion from our content */ -void +/** Re-read crop, fade, inter/out size and colour conversion from our content. + * @return true if this was possible, false if not. + */ +bool PlayerVideo::reset_metadata (dcp::Size video_container_size, dcp::Size film_frame_size) { shared_ptr<Content> content = _content.lock(); - DCPOMATIC_ASSERT (content); - DCPOMATIC_ASSERT (_video_frame); + if (!content || !_video_frame) { + return false; + } _crop = content->video->crop(); _fade = content->video->fade(_video_frame.get()); _inter_size = content->video->scale().size(content->video, video_container_size, film_frame_size); _out_size = video_container_size; _colour_conversion = content->video->colour_conversion(); + + return true; } diff --git a/src/lib/player_video.h b/src/lib/player_video.h index 7cc00f46b..f4bf2a471 100644 --- a/src/lib/player_video.h +++ b/src/lib/player_video.h @@ -71,7 +71,7 @@ public: void add_metadata (xmlpp::Node* node) const; void send_binary (boost::shared_ptr<Socket> socket) const; - void reset_metadata (dcp::Size video_container_size, dcp::Size film_frame_size); + bool reset_metadata (dcp::Size video_container_size, dcp::Size film_frame_size); bool has_j2k () const; dcp::Data j2k () const; |
