Properly handle unexpected end of stream

This commit is contained in:
Stone_Red
2023-12-18 20:14:42 +01:00
parent 9983170c8a
commit fabbc52a35
@@ -181,6 +181,12 @@ public class StreamingCommands(HostsManager hostsManager)
try
{
bytesRead = nwStream.Read(reciveBuffer, 0, reciveBuffer.Length);
if (bytesRead == 0 && bufferedWaveProvider.BufferedBytes == 0)
{
player.Stop();
ApiManager.SendNotificationMessage($"\r[{player.PlaybackState,-7}]");
}
}
catch (IOException ex)
{