Pause frame processing when window is not active
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "camera.h"
|
||||
#include "flash.h"
|
||||
#include "main.h"
|
||||
#include "pipeline.h"
|
||||
#include "process_pipeline.h"
|
||||
#include "state.h"
|
||||
@@ -240,6 +241,11 @@ update_controls()
|
||||
static void
|
||||
on_frame(MPBuffer buffer, void *_data)
|
||||
{
|
||||
// Don't process frame when the window is not active
|
||||
if (!check_window_active()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only update controls right after a frame was captured
|
||||
update_controls();
|
||||
|
||||
|
Reference in New Issue
Block a user