Skip to content

Commit

Permalink
Merge pull request opencv#1074 from devernay:2.4-cap_qt-multithread
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Donchenko authored and OpenCV Buildbot committed Jul 5, 2013
2 parents b6b1d5e + b524e27 commit c4e5986
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/highgui/src/cap_qtkit.mm
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,8 @@ - (IplImage*)getOutput;
double sleepTime = 0.005;
double total = 0;

NSDate *loopUntil = [NSDate dateWithTimeIntervalSinceNow:sleepTime];
while (![capture updateImage] && (total += sleepTime)<=timeOut &&
[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
beforeDate:loopUntil])
loopUntil = [NSDate dateWithTimeIntervalSinceNow:sleepTime];
while (![capture updateImage] && (total += sleepTime)<=timeOut)
usleep((int)(sleepTime*1000));

[localpool drain];

Expand Down

0 comments on commit c4e5986

Please sign in to comment.