]> git.sesse.net Git - nageru/blobdiff - shared/disk_space_estimator.cpp
Make it possible for the theme to override the status line.
[nageru] / shared / disk_space_estimator.cpp
index da55ee1e46b5018a0f8e381752bf661e55c11cc1..5cdc264652415bbbe9f8a5a7be7de7d929432544 100644 (file)
@@ -40,6 +40,10 @@ void DiskSpaceEstimator::report_append(const string &filename, uint64_t pts)
 
 void DiskSpaceEstimator::report_write_internal(const string &filename, off_t file_size, uint64_t pts)
 {
+       if (measure_points.empty()) {
+               first_pts_this_file = pts;
+       }
+
        // Reject points that are out-of-order (happens with B-frames).
        if (!measure_points.empty() && pts <= measure_points.back().pts) {
                return;
@@ -66,7 +70,7 @@ void DiskSpaceEstimator::report_write_internal(const string &filename, off_t fil
 
                // Only report every second, since updating the UI can be expensive.
                if (last_pts_reported == 0 || pts - last_pts_reported >= TIMEBASE) {
-                       callback(free_bytes, seconds_left);
+                       callback(free_bytes, seconds_left, double(pts - first_pts_this_file) / TIMEBASE);
                        last_pts_reported = pts;
                }
        }