Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit b02cfd0

Browse files
committed
Fix libcamera processing when there are no devices
1 parent e6d758f commit b02cfd0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/libcam.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ int cls_libcam::cam_start_mgr()
277277
MOTPLS_LOG(NTC, TYPE_VIDEO, NO_ERRNO, "cam_mgr started.");
278278

279279
if (camctx->conf->libcam_device == "camera0"){
280+
if (cam_mgr->cameras().size() == 0) {
281+
MOTPLS_LOG(ERR, TYPE_VIDEO, NO_ERRNO
282+
, "No camera devices found");
283+
return -1;
284+
};
280285
camid = cam_mgr->cameras()[0]->id();
281286
} else {
282287
MOTPLS_LOG(ERR, TYPE_VIDEO, NO_ERRNO

0 commit comments

Comments
 (0)