X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=disk_space_estimator.cpp;h=69de4d5578d24877664ff45ddb70b5972911e3fe;hb=3795723be95f2fe82f3c8b8b45b1a905b2c811fd;hp=5ce507020d58b6918049757f6d533cce02b7a069;hpb=fba9223dd99865e3cb90dc353f928ac3da3ac81e;p=nageru diff --git a/disk_space_estimator.cpp b/disk_space_estimator.cpp index 5ce5070..69de4d5 100644 --- a/disk_space_estimator.cpp +++ b/disk_space_estimator.cpp @@ -12,7 +12,7 @@ DiskSpaceEstimator::DiskSpaceEstimator(DiskSpaceEstimator::callback_t callback) { } -void DiskSpaceEstimator::report_write(const std::string &filename, uint64_t pts) +void DiskSpaceEstimator::report_write(const std::string &filename, size_t bytes, uint64_t pts) { // Reject points that are out-of-order (happens with B-frames). if (!measure_points.empty() && pts <= measure_points.back().pts) { @@ -24,13 +24,7 @@ void DiskSpaceEstimator::report_write(const std::string &filename, uint64_t pts) measure_points.pop_front(); } - struct stat st; - if (stat(filename.c_str(), &st) == -1) { - perror(filename.c_str()); - return; - } - - total_size += st.st_size; + total_size += bytes; struct statfs fst; if (statfs(filename.c_str(), &fst) == -1) {