From 71616201ff994af4693bf5252ef22b317ad0e439 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 16 Jun 2013 05:12:05 +1200 Subject: [PATCH] Ignore unknown wav chunks instead of throwing. --- OpenRA.FileFormats/FileFormats/WavLoader.cs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/OpenRA.FileFormats/FileFormats/WavLoader.cs b/OpenRA.FileFormats/FileFormats/WavLoader.cs index 07575cff35..73c6233bde 100644 --- a/OpenRA.FileFormats/FileFormats/WavLoader.cs +++ b/OpenRA.FileFormats/FileFormats/WavLoader.cs @@ -30,11 +30,6 @@ namespace OpenRA.FileFormats public readonly int DataSize; public readonly byte[] RawOutput; - public readonly int ListChunkSize; - - public readonly int FactChunkSize; - public readonly int Samples; - public WavLoader(Stream s) { while (s.Position < s.Length) @@ -68,16 +63,11 @@ namespace OpenRA.FileFormats DataSize = s.ReadInt32(); RawOutput = s.ReadBytes(DataSize); break; - case "LIST": - ListChunkSize = s.ReadInt32(); - s.ReadBytes(ListChunkSize); // Ignore annotation meta data. - break; - case "fact": - FactChunkSize = s.ReadInt32(); - Samples = s.ReadInt32(); - break; default: - throw new NotSupportedException("{0} chunks are not supported.".F(type)); + // Ignore unknown chunks + var chunkSize = s.ReadInt32(); + s.ReadBytes(chunkSize); + break; } } }