fix bug in hookEncodingProcess causing playRawStream to not work (#392)

* fix typo in hookEncodingProcess

* proper fix for _this4 bug in src, use arrow functions

* Get abalabahaha to build the noobs' changes
This commit is contained in:
Brian Tanner
2016-05-30 21:34:50 -04:00
committed by abalabahaha
parent 750f2a2b1b
commit a073010197
2 changed files with 5 additions and 3 deletions

View File

@@ -122,6 +122,8 @@ var AudioEncoder = (function () {
}; };
AudioEncoder.prototype.hookEncodingProcess = function hookEncodingProcess(resolve, reject, enc, stream) { AudioEncoder.prototype.hookEncodingProcess = function hookEncodingProcess(resolve, reject, enc, stream) {
var _this4 = this;
var processKilled = false; var processKilled = false;
function killProcess(cause) { function killProcess(cause) {
@@ -160,7 +162,7 @@ var AudioEncoder = (function () {
this.volume.once("readable", function () { this.volume.once("readable", function () {
var data = { var data = {
proc: enc, proc: enc,
stream: this.volume, stream: _this4.volume,
channels: 2 channels: 2
}; };

View File

@@ -130,7 +130,7 @@ export default class AudioEncoder {
enc.stdout.pipe(this.volume); enc.stdout.pipe(this.volume);
enc.stderr.on("data", function (data) { enc.stderr.on("data", (data) => {
ffmpegErrors += "\n" + new Buffer(data).toString().trim(); ffmpegErrors += "\n" + new Buffer(data).toString().trim();
}); });
@@ -148,7 +148,7 @@ export default class AudioEncoder {
} }
}); });
this.volume.once("readable", function () { this.volume.once("readable", () => {
var data = { var data = {
proc: enc, proc: enc,
stream: this.volume, stream: this.volume,