private void Empty(bool giveUp = false) { int numEntries1; AL.GetSource(this.alSourceId, ALGetSourcei.BuffersQueued, out numEntries1); if (numEntries1 <= 0) { return; } AL.SourceUnqueueBuffers(this.alSourceId, numEntries1); if (!ALHelper.TryCheck() && !giveUp) { int numEntries2; AL.GetSource(this.alSourceId, ALGetSourcei.BuffersProcessed, out numEntries2); int[] bids = new int[numEntries2]; if (numEntries2 > 0) { AL.SourceUnqueueBuffers(this.alSourceId, numEntries2, bids); ALHelper.Check(); } AL.SourceStop(this.alSourceId); ALHelper.Check(); this.Empty(true); } }
private void Empty() { int numEntries; AL.GetSource(this.alSourceId, ALGetSourcei.BuffersQueued, out numEntries); if (numEntries <= 0) { return; } AL.SourceUnqueueBuffers(this.alSourceId, numEntries); if (ALHelper.TryCheck()) { return; } AL.DeleteSource(this.alSourceId); this.alSourceId = AL.GenSource(); }