New option -calm_drive

This commit is contained in:
2009-08-24 18:36:49 +00:00
parent 82fae7f05d
commit 0109f4b2b5
5 changed files with 91 additions and 6 deletions

View File

@ -931,6 +931,7 @@ int Xorriso_assert_volid(struct XorrisO *xorriso, int msc1, int flag)
bit3= if the drive is a regular disk file: truncate it to
the write start address
bit5= do not print toc
bit6= do not calm down drive after aquiring it
@return <=0 failure , 1= ok
2=success, but not writeable with bit1
3=success, but not blank and not ISO with bit0
@ -1248,6 +1249,9 @@ 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:
Xorriso_process_msg_queues(xorriso,0);
@ -12552,3 +12556,33 @@ int Xorriso_md5_end(struct XorrisO *xorriso, void **ctx, char md5[16],
return(1);
}
/* @param flag bit0=input drive
bit1=output drive
*/
int Xorriso_drive_snooze(struct XorrisO *xorriso, int flag)
{
int in_is_out_too, ret;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
in_is_out_too= (xorriso->in_drive_handle == xorriso->out_drive_handle);
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);
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);
}
ret= 1;
ex:;
Xorriso_process_msg_queues(xorriso,0);
return(ret);
}