Fix crashes
This commit is contained in:
@@ -128,7 +128,7 @@ namespace MusicPlayer
|
|||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
AState = AudioState.STOPPED;
|
AState = AudioState.STOPPED;
|
||||||
main.form.SongFinished();
|
//main.form.SongFinished();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ namespace MusicPlayer
|
|||||||
waveOut.Init(blockAlignedStream);
|
waveOut.Init(blockAlignedStream);
|
||||||
waveOut.Play();
|
waveOut.Play();
|
||||||
|
|
||||||
if (CurrentSong.Seconds == 0)
|
if (CurrentSong == null || CurrentSong.Seconds == 0)
|
||||||
Length = ms.Length / waveOut.OutputWaveFormat.AverageBytesPerSecond;
|
Length = ms.Length / waveOut.OutputWaveFormat.AverageBytesPerSecond;
|
||||||
else
|
else
|
||||||
Length = CurrentSong.Seconds * waveOut.OutputWaveFormat.AverageBytesPerSecond;
|
Length = CurrentSong.Seconds * waveOut.OutputWaveFormat.AverageBytesPerSecond;
|
||||||
|
|||||||
Reference in New Issue
Block a user