Change internal name dist -> disk.
[dcpomatic.git] / src / lib / copy_to_drive_job.cc
index 828946123b6f9ce52a52e9c2f89d8c6f421c1d97..aaba3aaafa8e5ecb45d0972c6c5b16ec41fa4d21 100644 (file)
@@ -68,19 +68,24 @@ CopyToDriveJob::run ()
        }
 
        while (true) {
+               bool formatting = false;
                string s = _nanomsg.blocking_get ();
-               if (s == DIST_WRITER_OK) {
+               if (s == DISK_WRITER_OK) {
                        set_state (FINISHED_OK);
                        return;
-               } else if (s == DIST_WRITER_ERROR) {
+               } else if (s == DISK_WRITER_ERROR) {
                        string const m = _nanomsg.blocking_get ();
                        string const n = _nanomsg.blocking_get ();
                        throw CopyError (m, raw_convert<int>(n));
-               } else if (s == DIST_WRITER_FORMATTING) {
+               } else if (s == DISK_WRITER_FORMATTING) {
                        sub ("Formatting drive");
                        set_progress_unknown ();
-               } else if (s == DIST_WRITER_PROGRESS) {
-                       sub ("Copying DCP");
+                       formatting = true;
+               } else if (s == DISK_WRITER_PROGRESS) {
+                       if (formatting) {
+                               sub ("Copying DCP");
+                               formatting = false;
+                       }
                        set_progress (raw_convert<float>(_nanomsg.blocking_get()));
                }
        }