Enabled -multi and -msinfo with -as cdrecord
This commit is contained in:
@ -409,6 +409,7 @@ int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag)
|
||||
bit2= regard overwriteable media as blank
|
||||
bit3= if the drive is a regular disk file: truncate it to
|
||||
the write start address
|
||||
bit5= do not print toc
|
||||
@return <=0 failure , 1= ok
|
||||
2=success, but not writeable with bit1
|
||||
3=success, but not blank and not ISO with bit0
|
||||
@ -534,7 +535,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
{ret= -1; goto ex;}
|
||||
}
|
||||
}
|
||||
Xorriso_toc(xorriso, 1|2);
|
||||
if(!(flag&32))
|
||||
Xorriso_toc(xorriso, 1|2);
|
||||
{ret= 1+not_writeable; goto ex;}
|
||||
}
|
||||
|
||||
@ -578,7 +580,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
if(ret<=0) {
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
Xorriso_set_image_severities(xorriso, 0);
|
||||
Xorriso_give_up_drive(xorriso, 1);
|
||||
Xorriso_give_up_drive(xorriso, 1|((flag&32)>>2));
|
||||
sprintf(xorriso->info_text,"Cannot read ISO image tree");
|
||||
sev= "FAILURE";
|
||||
if(xorriso->img_read_error_mode==2)
|
||||
@ -618,22 +620,24 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
boot_fate);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
}
|
||||
|
||||
Xorriso_toc(xorriso, 1);
|
||||
if(xorriso->loaded_volid[0]!=0) {
|
||||
sprintf(xorriso->result_line,"Volume id : '%s'\n",xorriso->loaded_volid);
|
||||
Xorriso_result(xorriso,0);
|
||||
if(strcmp(xorriso->loaded_volid, xorriso->volid)!=0 &&
|
||||
!xorriso->volid_default) {
|
||||
sprintf(xorriso->result_line, "New volume id: '%s'\n", xorriso->volid);
|
||||
if(!(flag&32)) {
|
||||
Xorriso_toc(xorriso, 1);
|
||||
if(xorriso->loaded_volid[0]!=0) {
|
||||
sprintf(xorriso->result_line,"Volume id : '%s'\n",
|
||||
xorriso->loaded_volid);
|
||||
Xorriso_result(xorriso,0);
|
||||
if(strcmp(xorriso->loaded_volid, xorriso->volid)!=0 &&
|
||||
!xorriso->volid_default) {
|
||||
sprintf(xorriso->result_line, "New volume id: '%s'\n", xorriso->volid);
|
||||
Xorriso_result(xorriso,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
ret= 1+not_writeable;
|
||||
ex:
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
if(ret<=0) {
|
||||
hret= Xorriso_give_up_drive(xorriso, flag&3);
|
||||
hret= Xorriso_give_up_drive(xorriso, (flag&3)|((flag&32)>>2));
|
||||
if(hret<ret)
|
||||
ret= hret;
|
||||
}
|
||||
@ -812,7 +816,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
|
||||
int ret, relax= 0, i, profile, status, num_formats;
|
||||
int major, minor, micro;
|
||||
unsigned dummy;
|
||||
char xorriso_id[256], *img_id, profile_name[80];
|
||||
char xorriso_id[256], *img_id, profile_name[80], sfe[5*SfileadrL];
|
||||
struct isoburn_imgen_opts *sopts= NULL;
|
||||
struct burn_drive_info *dinfo, *source_dinfo;
|
||||
struct burn_drive *drive, *source_drive;
|
||||
@ -1037,7 +1041,8 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
|
||||
isoburn_sync_after_write(source_drive, drive, 0);
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
|
||||
sprintf(xorriso->info_text, "Writing completed sucessfully.\n\n");
|
||||
sprintf(xorriso->info_text, "Writing to %s completed sucessfully.\n\n",
|
||||
Text_shellsafe(xorriso->outdev,sfe,0));
|
||||
Xorriso_info(xorriso, 0);
|
||||
ret= 1;
|
||||
ex:;
|
||||
@ -5958,7 +5963,9 @@ int Xorriso_burn_track(struct XorrisO *xorriso, char *track_source, int flag)
|
||||
session= burn_session_create();
|
||||
ret= burn_disc_add_session(disc,session,BURN_POS_END);
|
||||
if(ret==0) {
|
||||
|
||||
/* >>> */;
|
||||
|
||||
goto ex;
|
||||
}
|
||||
track= burn_track_create();
|
||||
@ -5999,20 +6006,34 @@ int Xorriso_burn_track(struct XorrisO *xorriso, char *track_source, int flag)
|
||||
burn_session_add_track(session, track, BURN_POS_END);
|
||||
burn_source_free(data_src);
|
||||
|
||||
/* >>> MULTI :
|
||||
if grow_overwriteable_iso:
|
||||
consider overwriteables with ISO as appendable
|
||||
*/
|
||||
|
||||
disc_state = burn_disc_get_status(drive);
|
||||
if(disc_state == BURN_DISC_BLANK) {
|
||||
/* ok */;
|
||||
} else if(disc_state == BURN_DISC_APPENDABLE) {
|
||||
|
||||
/* MULTI : allow appendable media */
|
||||
/* ok */;
|
||||
/*
|
||||
if(!isoburn_needs_emulation(drive)) {
|
||||
sprintf(xorriso->info_text,
|
||||
"Appendable media with data detected. Need blank media.");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
*/
|
||||
|
||||
} else {
|
||||
if(disc_state == BURN_DISC_FULL) {
|
||||
|
||||
/* MULTI */
|
||||
|
||||
sprintf(xorriso->info_text,
|
||||
"Closed media with data detected. Need blank media.");
|
||||
"Closed media with data detected. Need blank or appendable media.");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
if(burn_disc_erasable(drive)) {
|
||||
sprintf(xorriso->info_text, "Try --blank_fast\n");
|
||||
@ -6040,6 +6061,10 @@ int Xorriso_burn_track(struct XorrisO *xorriso, char *track_source, int flag)
|
||||
|
||||
ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, 2);
|
||||
is_cd= (ret==2);
|
||||
|
||||
/* >>> MULTI :
|
||||
consider overwriteables as blank if not grow_overwriteable_iso*/
|
||||
|
||||
if(isoburn_needs_emulation(drive))
|
||||
burn_write_opts_set_start_byte(burn_options, (off_t) 0);
|
||||
ret= Xorriso_sanitize_image_size(xorriso, drive, disc, burn_options, 2);
|
||||
@ -6060,7 +6085,8 @@ int Xorriso_burn_track(struct XorrisO *xorriso, char *track_source, int flag)
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
|
||||
sprintf(xorriso->info_text, "Writing completed sucessfully.\n\n");
|
||||
sprintf(xorriso->info_text, "Writing to %s completed sucessfully.\n\n",
|
||||
Text_shellsafe(xorriso->outdev,sfe,0));
|
||||
Xorriso_info(xorriso, 0);
|
||||
ret= 1;
|
||||
ex:;
|
||||
@ -6075,7 +6101,6 @@ ex:;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* @param flag bit1= outdev rather than indev
|
||||
@return <0 error, 0 = no profile to see , 1= ok , 2= ok, is CD profile
|
||||
*/
|
||||
@ -6369,3 +6394,48 @@ int Xorriso_libburn_adr(struct XorrisO *xorriso, char *path, char adr[],
|
||||
strcpy(adr, local_adr);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/* MULTI : */
|
||||
/* @param flag bit1= obtain info from outdev
|
||||
*/
|
||||
int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag)
|
||||
{
|
||||
int ret, dummy;
|
||||
struct burn_drive *drive;
|
||||
struct burn_drive_info *dinfo;
|
||||
enum burn_disc_status disc_state;
|
||||
|
||||
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
|
||||
"on attempt to obtain msinfo", flag&2);
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
/* >>> if grow_overwriteable_iso :
|
||||
inquire by isoburn_disc_get_status()
|
||||
*/;
|
||||
disc_state = burn_disc_get_status(drive);
|
||||
if(disc_state != BURN_DISC_APPENDABLE) {
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
sprintf(xorriso->info_text,
|
||||
"%s media is not appendable. Cannot obtain -msinfo.",
|
||||
(flag&2) ? "Output" : "Input");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
ret= isoburn_disc_get_msc1(drive, msc1);
|
||||
if(ret<=0) {
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
sprintf(xorriso->info_text, "Cannot obtain address of most recent session");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &dummy, msc2);
|
||||
if(ret<0) {
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
sprintf(xorriso->info_text, "Cannot obtain next writeable address on media");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user