reduce dropped frames

This commit is contained in:
Sebastien Bourdeauducq 2023-09-13 16:01:46 +08:00
parent 6f12fe7ed5
commit 90ea4c599f
1 changed files with 4 additions and 2 deletions

View File

@ -71,11 +71,12 @@ static void poh_thread()
{
std::vector<float> block_mag(block_len);
poh_accept_input = true; // accept first block
while(!shutdown_threads) {
poh_accept_input = true;
poh_input_ready.acquire();
fft_mag(poh_input_block, block_mag.data(), block_len);
poh_accept_input = true; // poh_input_block not used again until next iteration
// stabilize laser
float freq_peak_local;
@ -107,10 +108,11 @@ static void ls_thread()
{
std::vector<float> block_mag(block_len);
ls_accept_input = true;
while(!shutdown_threads) {
ls_accept_input = true;
ls_input_ready.acquire();
fft_mag(ls_input_block, block_mag.data(), block_len);
ls_accept_input = true;
{
std::lock_guard<std::mutex> guard(wf_ls_mutex);
std::memmove(&wf_ls[wf_width], &wf_ls[0], sizeof(int)*wf_width*(wf_height - 1));