Merge pull request #2 from notthetup/master
Stop trying to read if no inputs are connected
This commit is contained in:
commit
d98126947b
@ -73,8 +73,10 @@ Mixer.prototype._read = function() {
|
|||||||
|
|
||||||
this.push(mixedBuffer);
|
this.push(mixedBuffer);
|
||||||
} else {
|
} else {
|
||||||
|
if (this.inputs.length){
|
||||||
setImmediate(this._read.bind(this));
|
setImmediate(this._read.bind(this));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Mixer.prototype.input = function (args) {
|
Mixer.prototype.input = function (args) {
|
||||||
@ -92,6 +94,10 @@ Mixer.prototype.input = function (args) {
|
|||||||
this.inputs.splice(this.inputs.indexOf(input), 1);
|
this.inputs.splice(this.inputs.indexOf(input), 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.inputs.length === 1){
|
||||||
|
setImmediate(this._read.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
return input;
|
return input;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user