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/player_video.cc | |
| parent | 3057189c6f30f822c0e8835a1257c1b94fce01df (diff) | |
Fix crash if quick_refresh() fails.
Diffstat (limited to 'src/lib/player_video.cc')
| -rw-r--r-- | src/lib/player_video.cc | 13 |
1 files changed, 9 insertions, 4 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; } |
