fix android possible waiting for image issue (#7994)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
6743b4f290
commit
a595d83232
@ -338,9 +338,7 @@ class MainService : Service() {
|
||||
).apply {
|
||||
setOnImageAvailableListener({ imageReader: ImageReader ->
|
||||
try {
|
||||
if (!isStart) {
|
||||
return@setOnImageAvailableListener
|
||||
}
|
||||
// If not call acquireLatestImage, listener will not be called again
|
||||
imageReader.acquireLatestImage().use { image ->
|
||||
if (image == null || !isStart) return@setOnImageAvailableListener
|
||||
val planes = image.planes
|
||||
|
Loading…
Reference in New Issue
Block a user