Use libdcp's warnings.h
[dcpomatic.git] / src / wx / standard_controls.cc
index 1e4ecc8d7fc74e5469c76759272110d209f42f1d..a2914d77ba0727f866bf1b874e63e9babd2b50a2 100644 (file)
 
 #include "film_viewer.h"
 #include "standard_controls.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/tglbtn.h>
 #include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
 
 
 using std::shared_ptr;
@@ -63,14 +66,15 @@ StandardControls::play_clicked ()
 void
 StandardControls::check_play_state ()
 {
-       if (!_film || _film->video_frame_rate() == 0) {
+       auto viewer = _viewer.lock ();
+       if (!_film || _film->video_frame_rate() == 0 || !viewer) {
                return;
        }
 
        if (_play_button->GetValue()) {
-               _viewer->start ();
+               viewer->start ();
        } else {
-               _viewer->stop ();
+               viewer->stop ();
        }
 }