summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-11-12 22:24:12 +0100
committerCarl Hetherington <cth@carlh.net>2023-11-19 22:34:01 +0100
commitc46f6125c482f2a3361cd33d1e1163927f038e9d (patch)
tree8b905cb411c395e617ba2c6d583497e1f4f43dea /tools
parente3fa86ef35f212b14b593dd36dbff66e845d37e4 (diff)
Report progress with done/total rather than a float.
Diffstat (limited to 'tools')
-rw-r--r--tools/dcprecover.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/dcprecover.cc b/tools/dcprecover.cc
index b78846ff..779cab60 100644
--- a/tools/dcprecover.cc
+++ b/tools/dcprecover.cc
@@ -65,12 +65,6 @@ help (string n)
}
-void progress (float f)
-{
- cout << (f * 100) << "% \r";
-}
-
-
int
main (int argc, char* argv[])
{
@@ -153,7 +147,9 @@ main (int argc, char* argv[])
auto asset = dcp::asset_factory(i.path(), true);
asset->set_file (*output / i.path().filename());
cout << "Hashing " << i.path().filename() << "\n";
- asset->hash (&progress);
+ asset->hash([](int64_t done, int64_t size) {
+ cout << (float(done) * 100 / size) << "% \r";
+ });
cout << "100% \n";
assets.push_back (asset);
} catch (dcp::ReadError& e) {