From d2733cf4863459853ab76b86b51d1cbda3a7f53b Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 6 Aug 2022 01:31:18 +0200 Subject: [PATCH] Fix autodetection getting stuck in 21:9 --- src/ext/lib/ar-detect/ArDetector.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/ext/lib/ar-detect/ArDetector.ts b/src/ext/lib/ar-detect/ArDetector.ts index 5c09381..884b6b8 100644 --- a/src/ext/lib/ar-detect/ArDetector.ts +++ b/src/ext/lib/ar-detect/ArDetector.ts @@ -480,11 +480,11 @@ class ArDetector { } } - // if (this && !this._halted && !this._paused) { + if (this && !this._halted && !this._paused) { this.animationFrameHandle = window.requestAnimationFrame( (ts) => this.animationFrameBootstrap(ts)); - // } else { - // this.logger.log('info', 'debug', `[ArDetect::animationFrameBootstrap] <@${this.arid}> Not renewing animation frame for some reason. Paused? ${this._paused}; Halted?: ${this._halted}, Exited?: ${this._exited}`); - // } + } else { + this.logger.log('info', 'debug', `[ArDetect::animationFrameBootstrap] <@${this.arid}> Not renewing animation frame for some reason. Paused? ${this._paused}; Halted?: ${this._halted}, Exited?: ${this._exited}`); + } } calculateArFromEdges(edges) { @@ -570,14 +570,8 @@ class ArDetector { return; } - if (!this.blackframeContext) { - this.init(); - } - let sampleCols = this.sampleCols.slice(0); - - await new Promise( resolve => { this.context.drawImage(this.video, 0, 0, this.canvas.width, this.canvas.height);