reduce wait time when waiting for first frame
This commit is contained in:
parent
9a5371c371
commit
dd384e9e6d
|
@ -3258,9 +3258,12 @@ void Monitor::get_ref_image() {
|
||||||
&& ! zm_terminate
|
&& ! zm_terminate
|
||||||
) {
|
) {
|
||||||
Warning( "Waiting for capture daemon" );
|
Warning( "Waiting for capture daemon" );
|
||||||
usleep( 100000 );
|
usleep( 50000 );
|
||||||
}
|
}
|
||||||
image_buffer[shared_data->last_write_index].mutex.lock();
|
int last_write_index = shared_data->last_write_index ;
|
||||||
ref_image.Assign( width, height, camera->Colours(), camera->SubpixelOrder(), image_buffer[shared_data->last_write_index].image->Buffer(), camera->ImageSize());
|
|
||||||
image_buffer[shared_data->last_write_index].mutex.unlock();
|
Warning( "Waiting for capture daemon unlock" );
|
||||||
|
image_buffer[last_write_index].mutex.lock();
|
||||||
|
ref_image.Assign( width, height, camera->Colours(), camera->SubpixelOrder(), image_buffer[last_write_index].image->Buffer(), camera->ImageSize());
|
||||||
|
image_buffer[last_write_index].mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue