Skip to content

Commit

Permalink
vtcapture: Relax sleeping
Browse files Browse the repository at this point in the history
Reduces CPU consumption with vsync enabled. On my TV this reduced CPU usage by half by giving up a bit of precision. Also throttle when currentCaptureBuffInfo fails (usually when there is no video)
  • Loading branch information
sundermann committed Oct 27, 2024
1 parent 6cd5326 commit b031a7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backends/libvtcapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ int capture_wait(void* state)
DBG("Returning with video capture stop (-99), to get restarted in next routine.");
return -99; // Restart video capture
} else if (ret != 0) {

usleep(100000);
ERR("vtCapture_currentCaptureBuffInfo() failed: %d", ret);
return -1;
}
Expand All @@ -280,7 +280,7 @@ int capture_wait(void* state)
WARN("captureCurrentBuffInfo() never returned a new plane!");
return -99; // Restart video capture
}
usleep(100);
usleep(1000);
}

self->curr_buff = self->buff.start_addr0;
Expand Down

0 comments on commit b031a7a

Please sign in to comment.