Move _state_timer into VideoView.
[dcpomatic.git] / src / wx / video_view.cc
index f8d44dc70137f321aec43a5610577032417ca1dc..e6588865641670b388a2643c761d7d070547902a 100644 (file)
 #include "film_viewer.h"
 #include "lib/butler.h"
 
+VideoView::VideoView (FilmViewer* viewer)
+       : _viewer (viewer)
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+       , _in_watermark (false)
+#endif
+       , _state_timer ("viewer")
+       , _video_frame_rate (0)
+       , _dropped (0)
+{
+
+}
+
 void
 VideoView::clear ()
 {
@@ -59,13 +71,6 @@ VideoView::get_next_frame (bool non_blocking)
                _player_video.first->eyes() != EYES_BOTH
                );
 
-       /* XXX_b: this is called from the GL thread so it shouldn't be opening error dialogs */
-       try {
-               _viewer->butler()->rethrow ();
-       } catch (DecodeError& e) {
-               error_dialog (get(), e.what());
-       }
-
        return true;
 }
 
@@ -92,3 +97,9 @@ VideoView::time_until_next_frame () const
        return (next.seconds() - time.seconds()) * 1000;
 }
 
+void
+VideoView::start ()
+{
+       boost::mutex::scoped_lock lm (_mutex);
+       _dropped = 0;
+}