From 5495bf571d81d41a55007961a0080e5950de7157 Mon Sep 17 00:00:00 2001 From: Jim Carroll Date: Sun, 26 Jun 2011 10:00:44 -0400 Subject: Fixed the Unrar code broken by the threading refactor. In several places in the rar code the new threading mechanisms were not used in a "functionally equivalent" manner. In five places the original code checked for a timeout using a "!= WAIT_OBJECT_0" which was interpreted as checking for a signaled state as if the "!" wasn't there. This commit fixes that problem. --- lib/UnrarXLib/extract.cpp | 2 +- lib/UnrarXLib/rdwrfn.cpp | 4 ++-- lib/UnrarXLib/unpack.cpp | 2 +- xbmc/filesystem/FileRar.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/UnrarXLib/extract.cpp b/lib/UnrarXLib/extract.cpp index 74a795b3cd..8206b187a9 100644 --- a/lib/UnrarXLib/extract.cpp +++ b/lib/UnrarXLib/extract.cpp @@ -867,7 +867,7 @@ void CmdExtract::UnstoreFile(ComprDataIO &DataIO,Int64 DestUnpSize) continue; DataIO.hBufferFilled->Reset(); DataIO.hBufferEmpty->Set(); - while (DataIO.hBufferFilled->WaitMSec(1)) + while (! DataIO.hBufferFilled->WaitMSec(1)) if (DataIO.hQuit->WaitMSec(1)) return; } diff --git a/lib/UnrarXLib/rdwrfn.cpp b/lib/UnrarXLib/rdwrfn.cpp index 6d1c055f1c..17e5b21b73 100644 --- a/lib/UnrarXLib/rdwrfn.cpp +++ b/lib/UnrarXLib/rdwrfn.cpp @@ -211,12 +211,12 @@ void ComprDataIO::UnpWrite(byte *Addr,uint Count) while(UnpackToMemorySize < (int)Count) { hBufferEmpty->Set(); - while( hBufferFilled->WaitMSec(1)) + while(! hBufferFilled->WaitMSec(1)) if (hQuit->WaitMSec(1)) return; } - if (hSeek->WaitMSec(1)) // we are seeking + if (! hSeek->WaitMSec(1)) // we are seeking { memcpy(UnpackToMemoryAddr,Addr,Count); UnpackToMemoryAddr+=Count; diff --git a/lib/UnrarXLib/unpack.cpp b/lib/UnrarXLib/unpack.cpp index 113260b121..265b54f5c4 100644 --- a/lib/UnrarXLib/unpack.cpp +++ b/lib/UnrarXLib/unpack.cpp @@ -411,7 +411,7 @@ void Unpack::Unpack29(bool Solid) if (UnpIO->UnpackToMemorySize > -1) { UnpIO->hBufferEmpty->Set(); - while (UnpIO->hBufferFilled->WaitMSec(1)) + while (! UnpIO->hBufferFilled->WaitMSec(1)) if (UnpIO->hQuit->WaitMSec(1)) return; } diff --git a/xbmc/filesystem/FileRar.cpp b/xbmc/filesystem/FileRar.cpp index 7fbce3c2aa..946581a24f 100644 --- a/xbmc/filesystem/FileRar.cpp +++ b/xbmc/filesystem/FileRar.cpp @@ -85,7 +85,7 @@ void CFileRarExtractThread::OnExit() void CFileRarExtractThread::Process() { - while (hQuit.WaitMSec(1)) + while (!hQuit.WaitMSec(1)) { if (hRestart.WaitMSec(1)) { -- cgit v1.2.3