Skip to content

Commit

Permalink
src/client: dont join if no thread
Browse files Browse the repository at this point in the history
  • Loading branch information
squat committed May 15, 2018
1 parent 4f34a57 commit 9217b25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void run(struct config *c) {
clock_gettime(CLOCK_MONOTONIC, &rstop);
diff = 1000000000 * (rstop.tv_sec - start.tv_sec);
diff += rstop.tv_nsec - start.tv_nsec;
mean = mean * (frames-1)/frames + diff/1000000.0/frames;
mean = mean * (frames - 1) / frames + diff / 1000000.0 / frames;
if (c->preview) {
cvShowImage("Darkapi Demo", frame);
esc = cvWaitKey((int)(wait - mean) <= 0 ? 1 : (wait - mean));
Expand Down Expand Up @@ -455,7 +455,9 @@ int main(int argc, char *argv[]) {
}
run(&c);
queue_stop(c.src->q);
pthread_join(c.thread, NULL);
if (c.src->camera) {
pthread_join(c.thread, NULL);
}

if (c.out) {
cvReleaseVideoWriter(&c.out);
Expand Down

0 comments on commit 9217b25

Please sign in to comment.