summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-01-11 16:16:39 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-01-11 16:16:39 +0100
commit9d3b82bf518798635ddc9f1de8446ff37a5e2281 (patch)
treed5ff0011ae4213f8ac8fc14ca72f38ba73c626a4
parent786fbaef73c522b6d138145b612034913ff70d03 (diff)
prevent empty video frame upon race
-rw-r--r--FTNoIR_Tracker_PT/pt_video_widget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/FTNoIR_Tracker_PT/pt_video_widget.cpp b/FTNoIR_Tracker_PT/pt_video_widget.cpp
index 38c49567..75fa18a0 100644
--- a/FTNoIR_Tracker_PT/pt_video_widget.cpp
+++ b/FTNoIR_Tracker_PT/pt_video_widget.cpp
@@ -21,7 +21,7 @@ void PTVideoWidget::update_image(const cv::Mat& frame)
const int rate = 40;
if (freshp)
return;
- if (!update_throttler.isValid() || update_throttler.elapsed() > rate)
+ if (frame.empty() || !update_throttler.isValid() || update_throttler.elapsed() > rate)
{
_frame = frame.clone();
update_throttler.restart();