Commit 93f7707
fix(macos): pair compatible format/range in set_all
Previously, when a camera advertises the requested resolution under
multiple formats (e.g. a UVC camera exposing 720p at both 30fps and
5fps), the outer loop overwrote for each
resolution-matching format while was left pointing at
an earlier format's frame rate. The resulting activeFormat +
activeVideoMinFrameDuration mismatch made AVFoundation throw
NSInvalidArgumentException, which unwinds through nokhwa's non-unwinding
objc exception bridge and hard-aborts the process.
Break out of the loop as soon as a format provides a frame-rate range
compatible with the requested fps, so selected_format and
selected_range always come from the same AVCaptureDeviceFormat.1 parent fa5a192 commit 93f7707
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1061 | 1065 | | |
1062 | 1066 | | |
1063 | 1067 | | |
| |||
0 commit comments