Fix bars at side/top/bottom of image in full-screen player (#1397).
[dcpomatic.git] / src / wx / video_waveform_dialog.cc
index c38dbf65d98a0d9b52ba44a64640a4a6b505aca1..6b0ed44104b655366ecc260f3395c5423f2583c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -28,8 +28,9 @@
 using std::cout;
 using boost::bind;
 using boost::weak_ptr;
+using boost::shared_ptr;
 
-VideoWaveformDialog::VideoWaveformDialog (wxWindow* parent, weak_ptr<const Film> film, FilmViewer* viewer)
+VideoWaveformDialog::VideoWaveformDialog (wxWindow* parent, weak_ptr<const Film> film, weak_ptr<FilmViewer> viewer)
        : wxDialog (
                parent,
                wxID_ANY,
@@ -106,7 +107,9 @@ VideoWaveformDialog::shown (wxShowEvent& ev)
 {
        _plot->set_enabled (ev.IsShown ());
        if (ev.IsShown ()) {
-               _viewer->slow_refresh ();
+               shared_ptr<FilmViewer> fv = _viewer.lock ();
+               DCPOMATIC_ASSERT (fv);
+               fv->slow_refresh ();
        }
 }