Error handling. Bugfix
This commit is contained in:
@@ -110,8 +110,18 @@ namespace MusicPlayer
|
||||
{
|
||||
long position = 0;
|
||||
ms.Position = position;
|
||||
Mp3FileReader mp3fr = null;
|
||||
|
||||
Mp3FileReader mp3fr = new Mp3FileReader(ms);
|
||||
try
|
||||
{
|
||||
mp3fr = new Mp3FileReader(ms);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
AState = AudioState.STOPPED;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
using (WaveStream blockAlignedStream = new BlockAlignReductionStream(WaveFormatConversionStream.CreatePcmStream(mp3fr)))
|
||||
{
|
||||
|
||||
@@ -231,6 +231,8 @@ namespace MusicPlayer
|
||||
private void ExitProgram()
|
||||
{
|
||||
main.audio.AState = AudioHandler.AudioState.STOPPED;
|
||||
NotifyIcon.Visible = false;
|
||||
NotifyIcon.Icon = null;
|
||||
System.Windows.Forms.Application.Exit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user