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;
// 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;
}
}