+
+
+void
+VideoView::add_dropped ()
+{
+ bool too_many = false;
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ ++_dropped;
+ if (_dropped > TOO_MANY_DROPPED_FRAMES) {
+ struct timeval now;
+ gettimeofday (&now, nullptr);
+ double const elapsed = seconds(now) - seconds(_dropped_check_period_start);
+ too_many = elapsed < TOO_MANY_DROPPED_PERIOD;
+ _dropped = 0;
+ _dropped_check_period_start = now;
+ }
+ }
+
+ if (too_many) {
+ emit (boost::bind(boost::ref(TooManyDropped)));
+ }
+}
+
+
+wxColour
+VideoView::pad_colour () const
+{
+ if (_viewer->pad_black()) {
+ return wxColour(0, 0, 0);
+ } else if (gui_is_dark()) {
+ return wxColour(50, 50, 50);
+ } else {
+ return wxColour(240, 240, 240);
+ }
+}
+