Fix hang on stream termination if no frames can be captured (#709)

This commit is contained in:
Cameron Gutman
2023-01-05 10:21:38 -06:00
committed by GitHub
parent f1c225fccc
commit 00aa23b342
9 changed files with 39 additions and 30 deletions

View File

@@ -60,11 +60,12 @@ struct av_display_t : public display_t {
img_next->row_pitch = CVPixelBufferGetBytesPerRow(pixelBuffer);
img_next->pixel_pitch = img_next->row_pitch / img_next->width;
img_next = snapshot_cb(img_next);
img_next = snapshot_cb(img_next, true);
return img_next != nullptr;
}];
// FIXME: We should time out if an image isn't returned for a while
dispatch_semaphore_wait(signal, DISPATCH_TIME_FOREVER);
return capture_e::ok;