Calculate proper length invalid seconds

This commit is contained in:
2015-11-08 18:51:21 +01:00
parent 401d832430
commit 7e2496dd74
+2 -1
View File
@@ -159,9 +159,10 @@ namespace MusicPlayer
waveOut.Play();
if (CurrentSong == null || CurrentSong.Seconds == 0)
Length = ms.Length / waveOut.OutputWaveFormat.AverageBytesPerSecond;
Length = ms.Length;
else
Length = CurrentSong.Seconds * waveOut.OutputWaveFormat.AverageBytesPerSecond;
CurrentTime = (int)(ms.Position / waveOut.OutputWaveFormat.AverageBytesPerSecond);
while (waveOut.PlaybackState != PlaybackState.Stopped)