X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fext.cc;fp=src%2Flib%2Fext.cc;h=b88a88726b99c6f79fc5b91398b2a54487ec8281;hb=78b98af2acc8a919ee23efccc27f656664362998;hp=086afd91e60288101a030f218fd08a644b0dfa9a;hpb=a2a4730255f33cae4fe3daa242a3cf5c32400c66;p=dcpomatic.git diff --git a/src/lib/ext.cc b/src/lib/ext.cc index 086afd91e..b88a88726 100644 --- a/src/lib/ext.cc +++ b/src/lib/ext.cc @@ -255,6 +255,16 @@ verify (vector const& copied_files, uint64_t total, Nanomsg* nanomsg } +static +void +format_progress (void* context, float progress) +{ + if (context) { + reinterpret_cast(context)->send(String::compose(DISK_WRITER_FORMAT_PROGRESS "\n%1\n", progress), SHORT_TIMEOUT); + } +} + + void #ifdef DCPOMATIC_WINDOWS dcpomatic::write (boost::filesystem::path dcp_path, string device, string, Nanomsg* nanomsg) @@ -329,11 +339,7 @@ try } LOG_DISK_NC ("Opened partition"); - if (nanomsg) { - nanomsg->send(DISK_WRITER_FORMATTING "\n", SHORT_TIMEOUT); - } - - r = ext4_mkfs(&fs, bd, &info, F_SET_EXT2); + r = ext4_mkfs(&fs, bd, &info, F_SET_EXT2, format_progress, nanomsg); if (r != EOK) { throw CopyError ("Failed to make filesystem", r); }