Fix autodetection getting stuck in 21:9

This commit is contained in:
Tamius Han 2022-08-06 01:31:18 +02:00
parent 7df62ba530
commit d2733cf486

View File

@ -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)); this.animationFrameHandle = window.requestAnimationFrame( (ts) => this.animationFrameBootstrap(ts));
// } else { } 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}`); 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) { calculateArFromEdges(edges) {
@ -570,14 +570,8 @@ class ArDetector {
return; return;
} }
if (!this.blackframeContext) {
this.init();
}
let sampleCols = this.sampleCols.slice(0); let sampleCols = this.sampleCols.slice(0);
await new Promise<void>( await new Promise<void>(
resolve => { resolve => {
this.context.drawImage(this.video, 0, 0, this.canvas.width, this.canvas.height); this.context.drawImage(this.video, 0, 0, this.canvas.width, this.canvas.height);