|
|
|
@ -1060,7 +1060,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag) |
|
|
|
|
burn_track_get_counters(tracks[0],&readcounter,&writecounter); |
|
|
|
|
xorriso->session_blocks= (int) (writecounter/ (off_t) 2048); |
|
|
|
|
sprintf(xorriso->info_text, |
|
|
|
|
"ISO image produced: %d sectors. Written to media: %d sectors at LBA %d\n", |
|
|
|
|
"ISO image produced: %d sectors\nWritten to media : %d sectors at LBA %d\n", |
|
|
|
|
(int) (readcounter/ (off_t) 2048), |
|
|
|
|
xorriso->session_blocks, xorriso->session_lba); |
|
|
|
|
Xorriso_info(xorriso, 0); |
|
|
|
@ -2667,6 +2667,7 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag) |
|
|
|
|
double percent = 1.0; |
|
|
|
|
int current_profile; |
|
|
|
|
char current_profile_name[80]; |
|
|
|
|
time_t start_time; |
|
|
|
|
char mode_names[4][80]= {"all", "fast", "deformat", "deformat_quickest"}; |
|
|
|
|
|
|
|
|
|
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, |
|
|
|
@ -2727,12 +2728,14 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag) |
|
|
|
|
burn_disc_erase(drive, (flag&1)); |
|
|
|
|
else |
|
|
|
|
isoburn_disc_erase(drive, (flag&1)); |
|
|
|
|
start_time= time(0); |
|
|
|
|
usleep(1000000); |
|
|
|
|
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 )", percent); |
|
|
|
|
sprintf(xorriso->info_text, "Blanking ( %.1f%% done in %d seconds )", |
|
|
|
|
percent, (int) (time(0) - start_time)); |
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); |
|
|
|
|
usleep(1000000); |
|
|
|
|
} |
|
|
|
@ -2818,28 +2821,18 @@ int Xorriso_format_media(struct XorrisO *xorriso, int flag) |
|
|
|
|
Xorriso_info(xorriso, 0); |
|
|
|
|
burn_disc_format(drive, size, mode_flag); |
|
|
|
|
|
|
|
|
|
#ifdef NIX |
|
|
|
|
|
|
|
|
|
/* <<< too boring */ |
|
|
|
|
ret= Xorriso_pacifier_loop(xorriso, drive, 0); |
|
|
|
|
if(ret<=0) |
|
|
|
|
return(ret); |
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
start_time= time(0); |
|
|
|
|
usleep(1000000); |
|
|
|
|
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)", |
|
|
|
|
sprintf(xorriso->info_text, "Formatting ( %.1f%% done in %d seconds )", |
|
|
|
|
percent, (int) (time(0) - start_time)); |
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); |
|
|
|
|
usleep(1000000); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif /* ! NIX */ |
|
|
|
|
|
|
|
|
|
Xorriso_process_msg_queues(xorriso,0); |
|
|
|
|
sprintf(xorriso->info_text, "Formatting done\n"); |
|
|
|
|
Xorriso_info(xorriso,0); |
|
|
|
@ -2901,6 +2894,73 @@ int Xorriso_blank_as_needed(struct XorrisO *xorriso, int flag) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* @return <=0 error, 1 success
|
|
|
|
|
*/ |
|
|
|
|
int Xorriso_list_formats(struct XorrisO *xorriso, int flag) |
|
|
|
|
{ |
|
|
|
|
int ret, i, status, num_formats, profile_no, type; |
|
|
|
|
off_t size; |
|
|
|
|
unsigned dummy; |
|
|
|
|
char status_text[80], profile_name[90], *respt; |
|
|
|
|
struct burn_drive_info *dinfo; |
|
|
|
|
struct burn_drive *drive; |
|
|
|
|
|
|
|
|
|
respt= xorriso->result_line; |
|
|
|
|
|
|
|
|
|
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, |
|
|
|
|
"on attempt to obtain format descriptor list", 2); |
|
|
|
|
if(ret<=0) |
|
|
|
|
return(0); |
|
|
|
|
|
|
|
|
|
ret = burn_disc_get_formats(drive, &status, &size, &dummy, |
|
|
|
|
&num_formats); |
|
|
|
|
if(ret <= 0) { |
|
|
|
|
sprintf(xorriso->info_text, "Cannot obtain format list info"); |
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); |
|
|
|
|
ret= 2; goto ex; |
|
|
|
|
} |
|
|
|
|
ret= Xorriso_toc(xorriso, 3); |
|
|
|
|
if(ret<=0) |
|
|
|
|
goto ex; |
|
|
|
|
ret= burn_disc_get_profile(drive, &profile_no, profile_name); |
|
|
|
|
if(ret<=0) |
|
|
|
|
goto ex; |
|
|
|
|
|
|
|
|
|
if(status == BURN_FORMAT_IS_UNFORMATTED) |
|
|
|
|
sprintf(status_text, "unformatted, up to %.1f MiB", |
|
|
|
|
((double) size) / 1024.0 / 1024.0); |
|
|
|
|
else if(status == BURN_FORMAT_IS_FORMATTED) { |
|
|
|
|
if(profile_no==0x12 || profile_no==0x13 || profile_no==0x1a || |
|
|
|
|
profile_no==0x43) |
|
|
|
|
sprintf(status_text, "formatted, with %.1f MiB", |
|
|
|
|
((double) size) / 1024.0 / 1024.0); |
|
|
|
|
else |
|
|
|
|
sprintf(status_text, "written, with %.1f MiB", |
|
|
|
|
((double) size) / 1024.0 / 1024.0); |
|
|
|
|
} else if(status == BURN_FORMAT_IS_UNKNOWN) { |
|
|
|
|
if (profile_no > 0) |
|
|
|
|
sprintf(status_text, "intermediate or unknown"); |
|
|
|
|
else |
|
|
|
|
sprintf(status_text, "no media or unknown media"); |
|
|
|
|
} else |
|
|
|
|
sprintf(status_text, "illegal status according to MMC-5"); |
|
|
|
|
sprintf(respt, "Format status: %s\n", status_text); |
|
|
|
|
Xorriso_result(xorriso,0); |
|
|
|
|
|
|
|
|
|
for (i= 0; i < num_formats; i++) { |
|
|
|
|
ret= burn_disc_get_format_descr(drive, i, &type, &size, &dummy); |
|
|
|
|
if (ret <= 0) |
|
|
|
|
continue; |
|
|
|
|
sprintf(respt, "Format idx %-2d: %2.2Xh , %.fs , %.1f MiB\n", |
|
|
|
|
i, type, ((double) size) / 2048.0, ((double) size) / 1024.0/1024.0); |
|
|
|
|
Xorriso_result(xorriso,0); |
|
|
|
|
} |
|
|
|
|
ret= 1; |
|
|
|
|
ex:; |
|
|
|
|
return(ret); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Xorriso_cannot_create_iter(struct XorrisO *xorriso, int iso_error,int flag) |
|
|
|
|
{ |
|
|
|
|
Xorriso_process_msg_queues(xorriso,0); |
|
|
|
|