diff --git a/BizHawk.Client.Common/7z/ArchiveUpdateCallback.cs b/BizHawk.Client.Common/7z/ArchiveUpdateCallback.cs index a9f838e70b..ea26b87a5c 100644 --- a/BizHawk.Client.Common/7z/ArchiveUpdateCallback.cs +++ b/BizHawk.Client.Common/7z/ArchiveUpdateCallback.cs @@ -263,13 +263,14 @@ namespace SevenZip _entries = new string[streamDict.Count]; streamDict.Keys.CopyTo(_entries, 0); _actualFilesCount = streamDict.Count; - foreach (Stream str in _streams) - { - if (str != null) - { - _bytesCount += str.Length; - } - } + //zero 11-oct-2014 - we want sequential streams only. length is unknown. + //foreach (Stream str in _streams) + //{ + // if (str != null) + // { + // _bytesCount += str.Length; + // } + //} CommonInit(compressor, updateData, directoryStructure); } @@ -780,25 +781,27 @@ namespace SevenZip private void IntEventArgsHandler(object sender, IntEventArgs e) { - lock (_files) - { - var pold = (byte) ((_bytesWrittenOld*100)/_bytesCount); - _bytesWritten += e.Value; - byte pnow; - if (_bytesCount < _bytesWritten) //Holy shit, this check for ZIP is golden - { - pnow = 100; - } - else - { - pnow = (byte)((_bytesWritten * 100) / _bytesCount); - } - if (pnow > pold) - { - _bytesWrittenOld = _bytesWritten; - OnCompressing(new ProgressEventArgs(pnow, (byte) (pnow - pold))); - } - } + //zero 11-oct-2014 - first of all, its possible for _files to be null (if we're compressing streams) + //second of all, if we're compressing streams, we cant possibly have _bytesCount anyway. so.. goodbye + //lock (_files) + //{ + // var pold = (byte) ((_bytesWrittenOld*100)/_bytesCount); + // _bytesWritten += e.Value; + // byte pnow; + // if (_bytesCount < _bytesWritten) //Holy shit, this check for ZIP is golden + // { + // pnow = 100; + // } + // else + // { + // pnow = (byte)((_bytesWritten * 100) / _bytesCount); + // } + // if (pnow > pold) + // { + // _bytesWrittenOld = _bytesWritten; + // OnCompressing(new ProgressEventArgs(pnow, (byte) (pnow - pold))); + // } + //} } } #endif diff --git a/BizHawk.Client.Common/7z/SevenZipCompressor.cs b/BizHawk.Client.Common/7z/SevenZipCompressor.cs index fcb2ea7307..a0c4661027 100644 --- a/BizHawk.Client.Common/7z/SevenZipCompressor.cs +++ b/BizHawk.Client.Common/7z/SevenZipCompressor.cs @@ -1685,7 +1685,9 @@ Enum.GetName(typeof(ZipEncryptionMethod), ZipEncryptionMethod)) #else foreach (var pair in streamDictionary) { - if (pair.Value != null && (!pair.Value.CanSeek || !pair.Value.CanRead)) + if (pair.Value != null && ( + //!pair.Value.CanSeek || //zero 11-oct-2014 - this is dumb, and I made it no longer necessary + !pair.Value.CanRead)) { if (!ThrowException(null, new ArgumentException( "The specified stream dictionary contains an invalid stream corresponding to the archive entry \"" + pair.Key + "\".",