New command -use_immed_bit, new -as cdrecord option use_immed_bit=
This commit is contained in:
@ -1692,7 +1692,7 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
|
||||
*/
|
||||
int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
|
||||
{
|
||||
int ret, do_deformat= 0, signal_mode;
|
||||
int ret, do_deformat= 0, signal_mode, using_immed;
|
||||
struct burn_drive_info *dinfo;
|
||||
struct burn_drive *drive;
|
||||
enum burn_disc_status disc_state;
|
||||
@ -1702,6 +1702,7 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
|
||||
char current_profile_name[80];
|
||||
time_t start_time;
|
||||
char mode_names[4][80]= {"all", "fast", "deformat", "deformat_quickest"};
|
||||
char progress_text[40];
|
||||
|
||||
ret= Xorriso_may_burn(xorriso, 0);
|
||||
if(ret <= 0)
|
||||
@ -1760,6 +1761,7 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
return(1);
|
||||
}
|
||||
using_immed= burn_drive_get_immed(drive);
|
||||
sprintf(xorriso->info_text, "Beginning to blank medium in mode '%s'.\n",
|
||||
mode_names[flag&3]);
|
||||
Xorriso_info(xorriso,0);
|
||||
@ -1777,12 +1779,16 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
|
||||
isoburn_disc_erase(drive, (flag&1));
|
||||
start_time= time(0);
|
||||
usleep(1000000);
|
||||
if(!using_immed)
|
||||
sprintf(progress_text, "synchronously since");
|
||||
while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) {
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */
|
||||
percent = 1.0 + ((double) p.sector+1.0) / ((double) p.sectors) * 98.0;
|
||||
sprintf(xorriso->info_text, "Blanking ( %.1f%% done in %d seconds )",
|
||||
percent, (int) (time(0) - start_time));
|
||||
if(using_immed)
|
||||
sprintf(progress_text, "%.1f%% done in", percent);
|
||||
sprintf(xorriso->info_text, "Blanking ( %s %d seconds )",
|
||||
progress_text, (int) (time(0) - start_time));
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0);
|
||||
usleep(1000000);
|
||||
}
|
||||
@ -1818,14 +1824,14 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
|
||||
*/
|
||||
int Xorriso_format_media(struct XorrisO *xorriso, off_t in_size, int flag)
|
||||
{
|
||||
int ret, mode_flag= 0, index, status, num_formats, signal_mode;
|
||||
int ret, mode_flag= 0, index, status, num_formats, signal_mode, using_immed;
|
||||
unsigned dummy;
|
||||
struct burn_drive_info *dinfo;
|
||||
struct burn_drive *drive;
|
||||
struct burn_progress p;
|
||||
double percent = 1.0;
|
||||
int current_profile;
|
||||
char current_profile_name[80];
|
||||
char current_profile_name[80], progress_text[40];
|
||||
off_t size= 0;
|
||||
time_t start_time;
|
||||
enum burn_disc_status disc_state;
|
||||
@ -1926,6 +1932,7 @@ int Xorriso_format_media(struct XorrisO *xorriso, off_t in_size, int flag)
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
return(1);
|
||||
}
|
||||
using_immed= burn_drive_get_immed(drive);
|
||||
sprintf(xorriso->info_text, "Beginning to format medium.\n");
|
||||
Xorriso_info(xorriso, 0);
|
||||
if(flag & 2)
|
||||
@ -1942,12 +1949,16 @@ int Xorriso_format_media(struct XorrisO *xorriso, off_t in_size, int flag)
|
||||
|
||||
start_time= time(0);
|
||||
usleep(1000000);
|
||||
if(!using_immed)
|
||||
sprintf(progress_text, "synchronously since");
|
||||
while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) {
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */
|
||||
percent = 1.0 + ((double) p.sector+1.0) / ((double) p.sectors) * 98.0;
|
||||
sprintf(xorriso->info_text, "Formatting ( %.1f%% done in %d seconds )",
|
||||
percent, (int) (time(0) - start_time));
|
||||
if(using_immed)
|
||||
sprintf(progress_text, "%.1f%% done in", percent);
|
||||
sprintf(xorriso->info_text, "Formatting ( %s %d seconds )",
|
||||
progress_text, (int) (time(0) - start_time));
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0);
|
||||
usleep(1000000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user