Przeglądaj źródła

Only initialize the RGBA32 array when needed for the bwFilter

Dominic Szablewski 12 lat temu
rodzic
commit
ace34821a0
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      jsmpg.js

+ 5 - 1
jsmpg.js Wyświetl plik

@@ -493,7 +493,11 @@ jsmpeg.prototype.initBuffers = function() {
493 493
 	this.canvas.height = this.height;
494 494
 	
495 495
 	this.currentRGBA = this.canvasContext.getImageData(0, 0, this.width, this.height);
496
-	this.currentRGBA32 = new Uint32Array( this.currentRGBA.data.buffer );
496
+
497
+	if( this.bwFilter ) {
498
+		// This fails in IE10; don't use the bwFilter if you need to support it.
499
+		this.currentRGBA32 = new Uint32Array( this.currentRGBA.data.buffer );
500
+	}
497 501
 	this.fillArray(this.currentRGBA.data, 255);
498 502
 };
499 503