New -calm_drive mode "revoke"

This commit is contained in:
2009-11-12 20:44:09 +00:00
parent 64d8349316
commit f95011d5e0
4 changed files with 31 additions and 25 deletions

View File

@ -1311,8 +1311,6 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
}
}
}
if((xorriso->do_calm_drive & 1) && !(flag & 64))
burn_drive_snooze(drive, 0); /* No need to make noise from start */
ret= 1+not_writeable;
ex:
@ -1321,6 +1319,9 @@ ex:
hret= Xorriso_give_up_drive(xorriso, (flag&3)|((flag&32)>>2));
if(hret<ret)
ret= hret;
} else {
if((xorriso->do_calm_drive & 1) && !(flag & 64))
burn_drive_snooze(drive, 0); /* No need to make noise from start */
}
if(ropts!=NULL)
isoburn_ropt_destroy(&ropts, 0);
@ -5326,7 +5327,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
"on attempt to print Table Of Content",
flag & (2 | 16));
if(ret<=0)
return(0);
{ret= 0; goto ex;}
respt= xorriso->result_line;
@ -5341,13 +5342,13 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
devadr);
Xorriso_toc_line(xorriso, flag & 8);
if(flag & 128)
return(1);
{ret= 1; goto ex;}
sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n",
dinfo[0].vendor, dinfo[0].product, dinfo[0].revision);
if((flag & 32) | !(flag & 1))
Xorriso_toc_line(xorriso, flag & 8);
if(flag & 32)
return(1);
{ret= 1; goto ex;}
ret= burn_disc_get_profile(drive, &profile_no, profile_name);
s= isoburn_disc_get_status(drive);
@ -5372,7 +5373,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if((flag & 64) || !(flag & 1)) {
Xorriso_media_product(xorriso, flag & (2 | 8 | 16));
if(xorriso->request_to_abort)
return(1);
{ret= 1; goto ex;}
}
sprintf(respt, "Media status : ");
@ -5396,9 +5397,9 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
Xorriso_toc_line(xorriso, flag & 8);
}
if(s != BURN_DISC_FULL && s != BURN_DISC_APPENDABLE)
return(1);
{ret= 1; goto ex;}
if(xorriso->request_to_abort)
return(1);
{ret= 1; goto ex;}
if(!(flag & 2))
Xorriso_show_boot_info(xorriso, 1 | (flag & 8) | ((flag & 1) << 1));
@ -5420,10 +5421,10 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0);
if(flag&1)
return(0);
{ret= 0; goto ex;}
sprintf(xorriso->info_text, "Cannot obtain Table Of Content");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0);
{ret= 0; goto ex;}
}
/* fabricate TOC */
@ -5537,7 +5538,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
}
}
if(xorriso->request_to_abort)
return(1);
{ret= 1; goto ex;}
num_wasted= lba - num_payload;
num_nondata= lba - num_data;
Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1);
@ -5563,7 +5564,9 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if (disc!=NULL)
isoburn_toc_disc_free(disc);
Xorriso_process_msg_queues(xorriso,0);
return(1);
ret= 1;
ex:;
return(ret);
}
@ -12878,6 +12881,7 @@ int Xorriso_md5_end(struct XorrisO *xorriso, void **ctx, char md5[16],
/* @param flag bit0=input drive
bit1=output drive
bit2= wake up rather than calm down
*/
int Xorriso_drive_snooze(struct XorrisO *xorriso, int flag)
{
@ -12889,14 +12893,14 @@ int Xorriso_drive_snooze(struct XorrisO *xorriso, int flag)
if((flag & 1) && xorriso->in_drive_handle != NULL) {
Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to calm drive", 0);
burn_drive_snooze(drive, 0);
burn_drive_snooze(drive, !!(flag & 4));
if(in_is_out_too)
{ret= 1; goto ex;}
}
if((flag&2) && xorriso->out_drive_handle!=NULL) {
Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to calm drive", 2);
burn_drive_snooze(drive, 0);
burn_drive_snooze(drive, !!(flag & 4));
}
ret= 1;
ex:;