+
+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)));
+ }
+}