Browse Source

fixed a major bug with Pause in WaveOut - could sometimes result in buffers not getting requeued, if they weren't in the queue before Pause was pressed. May have to port this back into 1.4

pull/1/head
markheath 14 years ago
parent
commit
809108eaba
  1. 17
      NAudio/Wave/WaveOutputs/WaveOut.cs

17
NAudio/Wave/WaveOutputs/WaveOut.cs

@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace NAudio.Wave
{
@ -147,6 +148,22 @@ namespace NAudio.Wave
}
else if (playbackState == PlaybackState.Paused)
{
for (int n = 0; n < NumberOfBuffers; n++)
{
if (!buffers[n].InQueue)
{
if (!buffers[n].OnDone())
{
playbackState = PlaybackState.Stopped;
break;
}
Debug.WriteLine(String.Format("Resume from Pause: Buffer [{0}] requeued", n));
}
else
{
Debug.WriteLine(String.Format("Resume from Pause: Buffer [{0}] already queued", n));
}
}
Resume();
playbackState = PlaybackState.Playing;
}

Loading…
Cancel
Save