Re-introduced capability of multi-session on overwritables. Spoiled by rev 4780.

This commit is contained in:
Thomas Schmitt 2012-07-08 20:06:34 +00:00
parent cb55c717bb
commit 4000d33656
2 changed files with 56 additions and 36 deletions

View File

@ -610,7 +610,7 @@ ex:;
int Xorriso_write_session(struct XorrisO *xorriso, int flag)
{
int ret, relax= 0, i, pacifier_speed= 0, data_lba, ext, is_bootable= 0;
int freshly_bootable= 0, hide_attr, pad_by_libisofs= 0, signal_mode;
int freshly_bootable= 0, hide_attr, pad_by_libisofs= 0, signal_mode, role;
char *xorriso_id= NULL, *img_id, *sfe= NULL, *out_cs, *part_image;
struct isoburn_imgen_opts *sopts= NULL;
struct burn_drive_info *dinfo, *source_dinfo;
@ -622,6 +622,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
struct burn_session **sessions;
struct burn_track **tracks;
enum burn_disc_status s;
struct burn_multi_caps *caps= NULL;
IsoImage *image= NULL;
IsoNode *root_node;
int profile_number;
@ -1010,38 +1011,6 @@ fprintf(stderr, "XORRISO_DEBUG: isoburn_igopt_set_tail_blocks(%d)\n",
burn_write_opts_set_stream_recording(burn_options, data_lba);
}
if(xorriso->do_tao) {
if (xorriso->do_tao > 0)
burn_write_opts_set_write_type(burn_options,
BURN_WRITE_TAO, BURN_BLOCK_MODE1);
else
burn_write_opts_set_write_type(burn_options,
BURN_WRITE_SAO, BURN_BLOCK_SAO);
ret = burn_precheck_write(burn_options, disc, reasons, 0);
if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,
"Cannot set write type %s for this medium.\n",
xorriso->do_tao > 0 ? "TAO" : "SAO");
sprintf(xorriso->info_text+strlen(xorriso->info_text),
"Reasons given:\n %s", reasons);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto cancel_iso;
}
} else {
if(burn_write_opts_auto_write_type(burn_options, disc, reasons, 0) ==
BURN_WRITE_NONE) {
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,
"Failed to find a suitable write mode with this media.\n");
sprintf(xorriso->info_text+strlen(xorriso->info_text),
"Reasons given:\n %s", reasons);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto cancel_iso;
}
}
ret= Xorriso_sanitize_image_size(xorriso, drive, disc, burn_options, flag&1);
if(ret<=0 || (flag&1)) {
Xorriso_process_msg_queues(xorriso,0);
@ -1056,11 +1025,57 @@ fprintf(stderr, "XORRISO_DEBUG: isoburn_igopt_set_tail_blocks(%d)\n",
if(ret <= 0)
goto cancel_iso;
role= burn_drive_get_drive_role(drive);
/* # define Libisoburn_write_type_autO yes */
#ifndef Libisoburn_write_type_autO
ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0);
if(ret > 0) {
if(caps->start_adr || role == 4) /* Multi will be emulated */
burn_write_opts_set_multi(burn_options, 0);
}
if(xorriso->do_tao) {
if (xorriso->do_tao > 0)
burn_write_opts_set_write_type(burn_options,
BURN_WRITE_TAO, BURN_BLOCK_MODE1);
else
burn_write_opts_set_write_type(burn_options,
BURN_WRITE_SAO, BURN_BLOCK_SAO);
ret = burn_precheck_write(burn_options, disc, reasons, 0);
if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,
"Cannot set write type %s for this medium.",
xorriso->do_tao > 0 ? "TAO" : "SAO");
sprintf(xorriso->info_text+strlen(xorriso->info_text),
"Reasons given:\n %s", reasons);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto cancel_iso;
}
sprintf(xorriso->info_text, "Explicitly chosen write type: %s",
xorriso->do_tao > 0 ? "TAO" : "SAO");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
} else {
if(burn_write_opts_auto_write_type(burn_options, disc, reasons, 0) ==
BURN_WRITE_NONE) {
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text,
"Failed to find a suitable write mode with this media.\n");
sprintf(xorriso->info_text+strlen(xorriso->info_text),
"Reasons given:\n %s", reasons);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto cancel_iso;
}
}
#endif /* Libisoburn_write_type_autO */
/* Important: do not return until burn_is_aborting() was checked */
signal_mode= 1;
ret= burn_drive_get_drive_role(drive);
if(ret == 1)
if(role == 1)
signal_mode|= 2;
Xorriso_set_signal_handling(xorriso, signal_mode);
@ -1139,6 +1154,8 @@ ex:;
isoburn_igopt_destroy(&sopts, 0);
if(burn_options != NULL)
burn_write_opts_free(burn_options);
if(caps != NULL)
burn_disc_free_multi_caps(&caps);
Xorriso_process_msg_queues(xorriso,0);
Xorriso_append_scdbackup_record(xorriso, 0);
Xorriso_free_meM(sfe);
@ -1975,6 +1992,9 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
sprintf(xorriso->info_text, "Explicitly chosen write type: %s",
xorriso->do_tao > 0 ? "TAO" : "SAO");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
} else {
if(burn_write_opts_auto_write_type(burn_options, disc, reasons, 0) ==
BURN_WRITE_NONE) {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2012.07.08.171526"
#define Xorriso_timestamP "2012.07.08.200735"