Preparations for DVD-R[W] Sequential Recording

This commit is contained in:
Thomas Schmitt 2007-01-30 17:54:39 +00:00
parent 1c750ea1e8
commit eae1198606
3 changed files with 23 additions and 20 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.01.29.175822"
#define Cdrskin_timestamP "2007.01.30.165317"

View File

@ -44,7 +44,7 @@ extern struct libdax_msgs *libdax_messenger;
#define Libburn_support_dvd_raM 1
/* ts A70129 >>> EXPERIMENTAL
/* ts A70129 >>> EXPERIMENTAL UNTESTED
#define Libburn_support_dvd_r_seQ 1
*/
@ -168,6 +168,7 @@ int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa)
struct buffer buf;
struct command c;
unsigned char *data;
int i;
mmc_function_spy("mmc_get_nwa");
c.retry = 1;
@ -178,11 +179,15 @@ int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa)
if (d->current_profile == 0x1a || d->current_profile == 0x13 ||
d->current_profile == 0x12 )
/* DVD+RW , DVD-RW restricted overwrite , DVD-RAM */
c.opcode[5] = 1;
trackno = 1;
else if (d->current_profile == 0x11 ||
d->current_profile == 0x14) /* DVD-R[W] Sequential */
trackno = d->last_track_no;
else /* mmc5r03c.pdf: valid only for CD, DVD+R, DVD+R DL */
c.opcode[5] = 0xFF;
} else
c.opcode[5] = trackno;
trackno = 0xFF;
}
for (i = 0; i < 4; i++)
c.opcode[2 + i] = (trackno >> (24 - 8 * i)) & 0xff;
c.page = &buf;
c.dir = FROM_DRIVE;
d->issue_command(d, &c);
@ -538,6 +543,7 @@ void mmc_read_disc_info(struct burn_drive *d)
/* ts A61020 */
d->start_lba = d->end_lba = -2000000000;
d->erasable = 0;
d->last_track_no = 1;
/* ts A61202 */
d->toc_entries = 0;
@ -595,7 +601,6 @@ void mmc_read_disc_info(struct burn_drive *d)
*/
d->status = BURN_DISC_BLANK;
d->last_track_no = 0;
break;
case 1:
d->status = BURN_DISC_APPENDABLE;
@ -1816,7 +1821,7 @@ int mmc_setup_drive(struct burn_drive *d)
d->needs_close_session = 0;
d->bg_format_status = -1;
d->num_format_descr = 0;
d->last_track_no = 0;
d->last_track_no = 1;
return 1;
}

View File

@ -196,8 +196,7 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
MMC-3 does not. I tried both. 0xFF was in effect when other
bugs finally gave up and made way for readable tracks. */
/* ts A70129
Probably the right value would be d->last_track_no+tnum for
appendables
Probably the right value for appendables is d->last_track_no
*/
d->close_track_session(o->drive, 0, 0xff);
@ -901,13 +900,10 @@ int burn_disc_close_track_dvd_minus_r(struct burn_write_opts *o,
return 2;
d->busy = BURN_DRIVE_CLOSING_SESSION;
/* 0xff was a name for the last track in MMC-1 but later
it vanished. One would need to determine the absolute
logical track number in multi-session situations.
Probably: d->last_track_no+tnum
*/
d->close_track_session(d, 0, 0xff); /* CLOSE TRACK, 001b */
/* Ignoring tnum here and hoping that d->last_track_no is correct */
d->close_track_session(d, 0, d->last_track_no); /* CLOSE TRACK, 001b */
d->busy = BURN_DRIVE_WRITING;
d->last_track_no++;
return 1;
}
@ -953,7 +949,7 @@ int burn_dvd_write_track(struct burn_write_opts *o,
d->progress.sector++;
}
/* Pad up buffer to next full 32 kB */
/* Pad up buffer to next full o->obs (usually 32 kB) */
if (o->obs_pad && out->bytes > 0 && out->bytes < o->obs) {
memset(out->data + out->bytes, 0, o->obs - out->bytes);
out->sectors += (o->obs - out->bytes) / 2048;
@ -1024,8 +1020,8 @@ int burn_disc_close_session_dvd_minus_r(struct burn_write_opts *o,
{
struct burn_drive *d = o->drive;
if (d->current_has_feat21h != 1) /* only for Incremental writing */
return 2;
if (d->current_has_feat21h != 1)
return 2; /* only for Incremental writing */
d->busy = BURN_DRIVE_CLOSING_SESSION;
d->close_track_session(d, 1, 0); /* CLOSE SESSION, 010b */
@ -1177,7 +1173,7 @@ int burn_disc_setup_dvd_minus_rw(struct burn_write_opts *o,
}
/* ts A70129 */
/* ts A70129 : for DVD-R[W] Sequential Recoding */
int burn_disc_setup_dvd_minus_r(struct burn_write_opts *o,
struct burn_disc *disc)
{
@ -1304,6 +1300,8 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
msg, 0,0);
goto early_failure;
}
/* ??? padding needed ??? cowardly doing it for now */
o->obs_pad = 1; /* fill-up track's last 32k buffer */
} else {
sprintf(msg, "Unsuitable media detected. Profile %4.4Xh %s",