PKGBUILDs/aur/par2cmdline/06-Introduced-conditional-compilation-to-speed-up-thing.patch

32 lines
983 B
Diff
Raw Normal View History

2011-06-09 21:56:14 +00:00
--- a/par2creatorsourcefile.cpp
+++ b/par2creatorsourcefile.cpp
@@ -213,21 +213,22 @@ bool Par2CreatorSourceFile::Open(CommandLine::NoiseLevel noiselevel, const Comma
}
}
+ // Define MPDL to skip reporting; speeds up things considerably
+#ifndef MPDL
if (noiselevel > CommandLine::nlQuiet)
{
// Display progress
u32 oldfraction = (u32)(1000 * offset / filesize);
- offset += want;
- u32 newfraction = (u32)(1000 * offset / filesize);
+ // The original source had here: offset += want;
+ // That's definitely an error, because offset must always be incremented!
+ u32 newfraction = (u32)(1000 * (offset + want) / filesize);
if (oldfraction != newfraction)
{
cout << newfraction/10 << '.' << newfraction%10 << "%\r" << flush;
}
}
- else
- {
- offset += want;
- }
+#endif
+ offset += want;
}
// Did we finish the last block