Skip to content

Commit

Permalink
issue #230: processing any freshest valid buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevaev committed Oct 3, 2023
1 parent 22a816b commit b3e4ea9
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/ustreamer/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,15 @@ int us_device_grab_buffer(us_device_s *dev, us_hw_buffer_s **hw) {
buf_got = true;

} else {
if(errno == EAGAIN) {
if(broken) {
return -2;
} else if(buf_got) {
break;
} else {
continue;
if (errno == EAGAIN) {
if (buf_got) {
break; // Process any latest valid frame
} else if (broken) {
return -2; // If we have only broken frames on this capture session
}
} else {
US_LOG_PERROR("Can't grab device buffer");
return -1;
}
US_LOG_PERROR("Can't grab device buffer");
return -1;
}
} while (true);

Expand Down

0 comments on commit b3e4ea9

Please sign in to comment.