Skip to content

Commit

Permalink
fix: opusscript encoder memleak
Browse files Browse the repository at this point in the history
  • Loading branch information
amishshah committed Apr 21, 2018
1 parent 4328866 commit 559e042
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/transcoders/Opus.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class OpusStream extends Transform {
(this.encoder.applyEncoderCTL || this.encoder.encoderCTL)
.apply(this.encoder, [CTL.FEC, Math.min(100, Math.max(0, percentage * 100))]);
}

_final() {
if (Opus.name === 'opusscript' && this.encoder) this.encoder.delete();
}
}

/**
Expand Down

0 comments on commit 559e042

Please sign in to comment.