Write type selection via libisoburn API to avoid redundant decisions

This commit is contained in:
Thomas Schmitt 2012-07-10 08:29:35 +00:00
parent d674f847c2
commit 922c95443f
2 changed files with 5 additions and 46 deletions

View File

@ -976,6 +976,10 @@ fprintf(stderr, "XORRISO_DEBUG: isoburn_igopt_set_tail_blocks(%d)\n",
{ret= 0; goto ex;} {ret= 0; goto ex;}
} }
ret = isoburn_igopt_set_write_type(sopts, xorriso->do_tao);
if(ret <= 0)
goto ex;
Xorriso_set_abort_severity(xorriso, 1); Xorriso_set_abort_severity(xorriso, 1);
if (xorriso->grow_blindly_msc2 >= 0 && if (xorriso->grow_blindly_msc2 >= 0 &&
xorriso->out_drive_handle != xorriso->in_drive_handle) { xorriso->out_drive_handle != xorriso->in_drive_handle) {
@ -1027,51 +1031,6 @@ fprintf(stderr, "XORRISO_DEBUG: isoburn_igopt_set_tail_blocks(%d)\n",
role= burn_drive_get_drive_role(drive); 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 */ /* Important: do not return until burn_is_aborting() was checked */
signal_mode= 1; signal_mode= 1;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2012.07.10.082919" #define Xorriso_timestamP "2012.07.10.083040"