New API calls isoburn_igopt_set_write_type() , isoburn_igopt_get_write_type()
This commit is contained in:
@ -864,14 +864,8 @@ void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
struct burn_drive *drive;
|
||||
char *reasons= NULL, *msg= NULL, *adr= NULL;
|
||||
struct stat stbuf;
|
||||
|
||||
#ifdef Libisoburn_write_type_autO
|
||||
|
||||
/* <<< on its way out */
|
||||
enum burn_write_types write_type;
|
||||
|
||||
#endif /* Libisoburn_write_type_autO */
|
||||
|
||||
drive= burn_write_opts_get_drive(opts);
|
||||
|
||||
reasons= calloc(1, BURN_REASONS_LEN);
|
||||
@ -923,44 +917,42 @@ void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Libisoburn_write_type_autO
|
||||
if(o->do_tao) {
|
||||
if (o->do_tao > 0)
|
||||
burn_write_opts_set_write_type(opts, BURN_WRITE_TAO, BURN_BLOCK_MODE1);
|
||||
else
|
||||
burn_write_opts_set_write_type(opts, BURN_WRITE_SAO, BURN_BLOCK_SAO);
|
||||
|
||||
/* <<< on its way out */
|
||||
ret = burn_precheck_write(opts, disc, reasons, 0);
|
||||
if(ret <= 0) {
|
||||
sprintf(msg, "Cannot set write type %s for this medium.",
|
||||
o->do_tao > 0 ? "TAO" : "SAO");
|
||||
sprintf(msg + strlen(msg), "Reasons given:\n %s", reasons);
|
||||
goto no_write_type;
|
||||
}
|
||||
sprintf(msg, "Explicitly chosen write type: %s",
|
||||
o->do_tao > 0 ? "TAO" : "SAO");
|
||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "NOTE", 0);
|
||||
} else {
|
||||
write_type= burn_write_opts_auto_write_type(opts, disc, reasons, 0);
|
||||
if (write_type == BURN_WRITE_NONE) {
|
||||
sprintf(msg, "Failed to find a suitable write type:\n%s", reasons);
|
||||
no_write_type:;
|
||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
|
||||
if(o!=NULL)
|
||||
o->wrote_well= 0;
|
||||
/* To cause a negative reply with burn_drive_wrote_well() */
|
||||
burn_drive_cancel(drive);
|
||||
goto ex;
|
||||
}
|
||||
|
||||
write_type= burn_write_opts_auto_write_type(opts, disc, reasons, 0);
|
||||
if (write_type == BURN_WRITE_NONE) {
|
||||
sprintf(msg, "Failed to find a suitable write mode:\n%s", reasons);
|
||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
|
||||
if(o!=NULL)
|
||||
o->wrote_well= 0;
|
||||
/* To cause a negative reply with burn_drive_wrote_well() */
|
||||
burn_drive_cancel(drive);
|
||||
goto ex;
|
||||
sprintf(reasons, "%d", (int) write_type);
|
||||
sprintf(msg, "Write_type = %s\n",
|
||||
(write_type == BURN_WRITE_SAO ? "SAO" :
|
||||
(write_type == BURN_WRITE_TAO ? "TAO" : reasons)));
|
||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "DEBUG", 0);
|
||||
}
|
||||
|
||||
sprintf(reasons, "%d", (int) write_type);
|
||||
sprintf(msg, "Write_type = %s\n",
|
||||
(write_type == BURN_WRITE_SAO ? "SAO" :
|
||||
(write_type == BURN_WRITE_TAO ? "TAO" : reasons)));
|
||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "DEBUG", 0);
|
||||
|
||||
#else /* Libisoburn_write_type_autO */
|
||||
|
||||
/* The caller is in charge to select the write type */
|
||||
ret = burn_precheck_write(opts, disc, reasons, 0);
|
||||
if(ret <= 0) {
|
||||
sprintf(msg, "Write parameters not properly set for this medium:\n %s",
|
||||
reasons);
|
||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
|
||||
if(o!=NULL)
|
||||
o->wrote_well= 0;
|
||||
/* To cause a negative reply with burn_drive_wrote_well() */
|
||||
burn_drive_cancel(drive);
|
||||
goto ex;
|
||||
}
|
||||
|
||||
#endif /* ! Libisoburn_write_type_autO */
|
||||
|
||||
#ifdef Hardcoded_cd_rW
|
||||
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
|
||||
fprintf(stderr, "Setting write address to LBA %d\n", Hardcoded_cd_rw_nwA);
|
||||
|
Reference in New Issue
Block a user