refactoring

This commit is contained in:
Maxim Devaev
2024-03-10 12:25:08 +02:00
parent 2e67a46eb8
commit 6475eeef4c
2 changed files with 5 additions and 7 deletions

View File

@@ -216,12 +216,11 @@ static void _main_loop(void) {
}
us_hw_buffer_s *hw;
const int n_buf = us_device_grab_buffer(dev, &hw);
switch (n_buf) {
switch (us_device_grab_buffer(dev, &hw)) {
case -2: continue; // Broken frame
case -1: goto close; // Any error
default: break; // Grabbed on >= 0
}
assert(n_buf >= 0);
if (drm_opened == 0) {
CHECK(us_drm_expose_dma(drm, hw));