Added IDisposable to RTPWriteStream. Flush on Dispose.

This commit is contained in:
RogueException
2016-12-30 17:20:39 -04:00
parent 082ddc616c
commit d6dc3a4e4b

View File

@@ -34,6 +34,12 @@ namespace Discord.Audio
_nonce[11] = (byte)(_ssrc >> 0);
}
protected override void Dispose(bool disposing)
{
Flush();
base.Dispose(disposing);
}
public override void Write(byte[] buffer, int offset, int count)
{
WriteAsync(buffer, offset, count, CancellationToken.None).GetAwaiter().GetResult();