mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Fix camera failure handling
The camera capture must be closed on error (isClosed() returns the value of the disconnected flag).
This commit is contained in:
parent
a6c16180ee
commit
df91514112
1 changed files with 2 additions and 0 deletions
|
|
@ -323,6 +323,7 @@ public class CameraCapture extends SurfaceCapture {
|
|||
currentSession = session;
|
||||
} catch (CameraAccessException e) {
|
||||
Ln.e("Camera error", e);
|
||||
disconnected.set(true);
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
|
@ -330,6 +331,7 @@ public class CameraCapture extends SurfaceCapture {
|
|||
@Override
|
||||
public void onConfigureFailed(CameraCaptureSession session) {
|
||||
Ln.e("Camera configuration error");
|
||||
disconnected.set(true);
|
||||
invalidate();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue