From db3322ebcd8fedd2417b99f64dc9e80efbcb091a Mon Sep 17 00:00:00 2001 From: Edgar O Silva Date: Tue, 7 Jan 2014 20:36:08 -0600 Subject: [PATCH] Fix to use always the first param as timeout if only that one was provided while keeping backwards compatability with 2 params. --- src/HighGUI.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/HighGUI.cc b/src/HighGUI.cc index 217917a..9c057fd 100644 --- a/src/HighGUI.cc +++ b/src/HighGUI.cc @@ -74,10 +74,12 @@ NamedWindow::BlockingWaitKey(const v8::Arguments& args){ //SETUP_FUNCTION(NamedWindow) int time = 0; - if (args.Length() > 0){ + if (args.Length() > 1){ time = args[1]->IntegerValue(); }else{ - time = args[0]->IntegerValue(); + if (args.Length() > 0){ + time = args[0]->IntegerValue(); + } } int res = cv::waitKey(time);