Skip to content

Commit

Permalink
fix: Use acquireLatestImage instead of acquireNextImage for CodeS…
Browse files Browse the repository at this point in the history
…canner (#2549)
  • Loading branch information
mrousavy authored Feb 13, 2024
1 parent b7e24c4 commit ec7ce36
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CodeScannerPipeline(
var isBusy = false
imageReader = ImageReader.newInstance(size.width, size.height, format, MAX_IMAGES)
imageReader.setOnImageAvailableListener({ reader ->
val image = reader.acquireNextImage() ?: return@setOnImageAvailableListener
val image = reader.acquireLatestImage() ?: return@setOnImageAvailableListener

if (isBusy) {
// We're currently executing on a previous Frame, so we skip this one.
Expand Down

0 comments on commit ec7ce36

Please sign in to comment.