diff --git a/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs b/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs index 4c7ffe4..991eba8 100644 --- a/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs +++ b/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs @@ -514,6 +514,18 @@ namespace skyscraper5.Data string filename = String.Format("/SSDP/{0}.xml", ssdpDevice.UniqueServiceName.SanitizeFileName()); byte[] bytes = GetObject(filename); return bytes; - } + } + + public bool TestForSisDsaci(int value1, int value2, ushort groupId, int versionNumber) + { + string filename = String.Format("DVB-SIS/{0}/{1}/Group{2}_Version{3}.xml"); + return FileExists(filename); + } + + public void StoreSisDsaci(int value1, int value2, ushort currentDsaGroupId, int versionNumber, Stream dsaci) + { + string filename = String.Format("DVB-SIS/{0}/{1}/Group{2}_Version{3}.xml"); + WriteObject(filename, dsaci); + } } } diff --git a/skyscraper8/GS/GSE-RollingSyncByte/GseWithRollingSyncByteReader.cs b/skyscraper8/GS/GSE-RollingSyncByte/GseWithRollingSyncByteReader.cs index a802e8f..588c8fc 100644 --- a/skyscraper8/GS/GSE-RollingSyncByte/GseWithRollingSyncByteReader.cs +++ b/skyscraper8/GS/GSE-RollingSyncByte/GseWithRollingSyncByteReader.cs @@ -118,6 +118,7 @@ public class GseWithRollingSyncByteReader : IMisHandler { byte[] gseDataBytes = fragments[gsePacket.FragmentId.Value].GetGseDataBytes(); HandleAssembledFrame(fragments[gsePacket.FragmentId.Value].ProtocolType, gseDataBytes, fragments[gsePacket.FragmentId.Value].Label); + return; } } diff --git a/skyscraper8/GS/MisHandlerProxy.cs b/skyscraper8/GS/MisHandlerProxy.cs index eb6228b..b8a3f0f 100644 --- a/skyscraper8/GS/MisHandlerProxy.cs +++ b/skyscraper8/GS/MisHandlerProxy.cs @@ -64,7 +64,15 @@ class MisHandlerProxy : IMisHandler state = 3; break; case 3: - misHandler.PushFrame(bbHeader, readOnlySpan); + try + { + misHandler.PushFrame(bbHeader, readOnlySpan); + } + catch (Exception e) + { + logger.ErrorFormat("An error occurred while handling a GS packet. This means that the stream type autodetection guessed wrong."); + OnUnknownStreamFormat(); + } break; default: if (!unknownStateError) @@ -145,21 +153,35 @@ class MisHandlerProxy : IMisHandler SucessfulDetection(DetectedGsType.GseWithRollingSyncByte); return true; } - } - - logger.WarnFormat("MIS {0} has an unknown stream type. The IP packet detection algorithm from older skyscraper8 versions will be used. For further analysis, please consider submitting a sample of this stream.", Context.GetMisId()); - misHandler = new IPv4PacketBruteforce(Context); - return false; + } + + OnUnknownStreamFormat(); + return false; } private void DrainQueue() { - while (waitingPackets.Count > 0) - { - Tuple dequeue = waitingPackets.Dequeue(); - misHandler.PushFrame(dequeue.Item1, dequeue.Item2); - } - waitingPackets = null; + try + { + while (waitingPackets.Count > 0) + { + Tuple dequeue = waitingPackets.Dequeue(); + misHandler.PushFrame(dequeue.Item1, dequeue.Item2); + } + waitingPackets = null; + } + catch (Exception ex) + { + logger.ErrorFormat("While trying to handle the buffered GS packets, an error occurred. This means that the stream type autodetection guessed wrong."); + OnUnknownStreamFormat(); + DrainQueue(); + } + } + + private void OnUnknownStreamFormat() + { + logger.WarnFormat("MIS {0} has an unknown stream type. The IP packet detection algorithm from older skyscraper8 versions will be used. For further analysis, please consider submitting a sample of this stream.", Context.GetMisId()); + misHandler = new IPv4PacketBruteforce(Context); } private bool AnalyzeCrc32Values() diff --git a/skyscraper8/Properties/launchSettings.json b/skyscraper8/Properties/launchSettings.json index 311a2e0..71b9fbd 100644 --- a/skyscraper8/Properties/launchSettings.json +++ b/skyscraper8/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "skyscraper8": { "commandName": "Project", - "commandLineArgs": "\"C:\\Users\\Sascha Schiemann\\Downloads\\11476 H_GSE_(1)\\11476 V_GSE_.ts\"", + "commandLineArgs": "\"F:\\utena\\0008W_Thor\\recap-max-sx8\\skyscraper_20251029_2110_0008W_10841_V_24497.ts\"", "remoteDebugEnabled": false }, "Container (Dockerfile)": {