summaryrefslogtreecommitdiff
path: root/src/wx/player_information.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-02-22 01:25:03 +0100
committerCarl Hetherington <cth@carlh.net>2024-02-22 01:25:03 +0100
commita45f6245e8cc785fab436c9282fa3d1baf3a8575 (patch)
treec6ae82be2319446c35ebad6666f68dbb109f8904 /src/wx/player_information.cc
parent6c3ded5baac385d95ec2cf5e625c6c796c23e318 (diff)
parent3ffd0163026be24e5373e0674c3301ed37546e44 (diff)
Merge tag 'v2.16.78' into v2.17.xv2.17.12
Diffstat (limited to 'src/wx/player_information.cc')
-rw-r--r--src/wx/player_information.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc
index 806611140..057d26740 100644
--- a/src/wx/player_information.cc
+++ b/src/wx/player_information.cc
@@ -161,7 +161,13 @@ PlayerInformation::triggered_update ()
DCPOMATIC_ASSERT (dcp->video);
- checked_set (_dcp[r++], wxString::Format(_("Size: %dx%d"), dcp->video->size().width, dcp->video->size().height));
+ auto const size = dcp->video->size();
+
+ if (size) {
+ checked_set(_dcp[r++], wxString::Format(_("Size: %dx%d"), size->width, size->height));
+ } else {
+ checked_set(_dcp[r++], _("Size: unknown"));
+ }
if (dcp->video_frame_rate()) {
checked_set (_dcp[r++], wxString::Format(_("Frame rate: %d"), (int) lrint(*dcp->video_frame_rate())));
}
@@ -186,14 +192,18 @@ PlayerInformation::triggered_update ()
checked_set (_dcp[r++], std_to_wx(len));
- auto decode = dcp->video->size();
+ auto decode = size;
auto reduction = _viewer.dcp_decode_reduction();
- if (reduction) {
- decode.width /= pow(2, *reduction);
- decode.height /= pow(2, *reduction);
+ if (reduction && decode) {
+ decode->width /= pow(2, *reduction);
+ decode->height /= pow(2, *reduction);
}
- checked_set (_decode_resolution, wxString::Format(_("Decode resolution: %dx%d"), decode.width, decode.height));
+ if (decode) {
+ checked_set(_decode_resolution, wxString::Format(_("Decode resolution: %dx%d"), decode->width, decode->height));
+ } else {
+ checked_set(_decode_resolution, _("Decode resolution: unknown"));
+ }
DCPOMATIC_ASSERT(r <= dcp_lines);