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 {
|
).apply {
|
||||||
setOnImageAvailableListener({ imageReader: ImageReader ->
|
setOnImageAvailableListener({ imageReader: ImageReader ->
|
||||||
try {
|
try {
|
||||||
if (!isStart) {
|
// If not call acquireLatestImage, listener will not be called again
|
||||||
return@setOnImageAvailableListener
|
|
||||||
}
|
|
||||||
imageReader.acquireLatestImage().use { image ->
|
imageReader.acquireLatestImage().use { image ->
|
||||||
if (image == null || !isStart) return@setOnImageAvailableListener
|
if (image == null || !isStart) return@setOnImageAvailableListener
|
||||||
val planes = image.planes
|
val planes = image.planes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user