Made CD with unclosed track blankable (by -force)

This commit is contained in:
2006-11-06 15:52:45 +00:00
parent db4522bbdc
commit 448aac8880
7 changed files with 84 additions and 13 deletions

View File

@ -1176,6 +1176,16 @@ int burn_disc_pretend_blank(struct burn_drive *d)
return 1;
}
/* ts A61106 API function */
int burn_disc_pretend_full(struct burn_drive *d)
{
if (d->status != BURN_DISC_UNREADY &&
d->status != BURN_DISC_UNSUITABLE)
return 0;
d->status = BURN_DISC_FULL;
return 1;
}
/* ts A61021: new API function */
int burn_disc_read_atip(struct burn_drive *d)
{

View File

@ -658,6 +658,15 @@ enum burn_disc_status burn_disc_get_status(struct burn_drive *drive);
int burn_disc_pretend_blank(struct burn_drive *drive);
/* ts A61106 */
/** WARNING: This overrides the safety measures against unsuitable media.
Sets the drive status to BURN_DISC_FULL if it is BURN_DISC_UNREADY
or BURN_DISC_UNSUITABLE. Thus marking media as blankable which actually
failed to declare themselves either blank or (partially) filled.
*/
int burn_disc_pretend_full(struct burn_drive *drive);
/* ts A61021 */
/** Reads ATIP information from inserted media. To be obtained via
burn_drive_get_write_speed(), burn_drive_get_min_write_speed(),

View File

@ -312,6 +312,7 @@ void mmc_read_toc(struct burn_drive *d)
if (c.error) {
/* ts A61020 : this snaps on non-blank DVD media */
/* ts A61106 : also snaps on CD with unclosed track/session */
/* Very unsure wether this old measure is ok.
Obviously higher levels do not care about this.
DVD+RW burns go on after passing through here.

View File

@ -692,11 +692,8 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
if (!c->retry) {
c->error = 1;
/* ts A61030 */
/* >>> to become d->notify_error() */
scsi_notify_error(d, c, s.sbp, s.sb_len_wr, 0);
return 1;
/* A61106: rather than : return 1 */
goto ex;
}
switch (scsi_error(d, s.sbp, s.sb_len_wr)) {
case RETRY:
@ -711,6 +708,13 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
done = 1;
}
} while (!done);
/* ts A61106 */
ex:;
if (c->error) {
/* >>> to become d->notify_error() */
scsi_notify_error(d, c, s.sbp, s.sb_len_wr, 0);
}
return 1;
}
@ -727,12 +731,17 @@ int scsi_notify_error(struct burn_drive *d, struct command *c,
if(!(flag & 1))
return 1;
key = sense[2];
asc = sense[12];
ascq = sense[13];
sprintf(msg,"SCSI error condition on command %2.2Xh : ", c->opcode[0]);
sprintf(msg+strlen(msg), "key= %x asc= %x ascq= %x\n", key,asc,ascq);
sprintf(msg,"SCSI error condition on command %2.2Xh :", c->opcode[0]);
if (senselen > 2) {
key = sense[2];
sprintf(msg+strlen(msg), " key=%xh", key);
}
if (senselen > 13) {
asc = sense[12];
ascq = sense[13];
sprintf(msg+strlen(msg), " asc=%xh ascq=%xh", asc, ascq);
}
ret = libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002010f,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
return ret;

View File

@ -7,6 +7,13 @@
/* #include <a ssert.h> */
/* ts A61106 : Deliberate defect provocation macros
DO NOT DEFINE THESE IF YOU WANT SUCCESSFUL TAO !
#define Libburn_experimental_no_close_tracK 1
#define Libburn_experimental_no_close_sessioN 1
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@ -132,6 +139,11 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
struct burn_track *t;
int todo, step, cancelled, seclen;
/* ts A61106 */
#ifdef Libburn_experimental_no_close_tracK
return 1;
#endif
d = o->drive;
t = s->track[tnum];
@ -187,6 +199,12 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
/* ts A61030 */
int burn_write_close_session(struct burn_write_opts *o, struct burn_session *s)
{
/* ts A61106 */
#ifdef Libburn_experimental_no_close_sessioN
return 1;
#endif
libdax_msgs_submit(libdax_messenger, o->drive->global_index,0x00020119,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
"Closing session", 0, 0);