Moved minimum tracksize padding out of TAO track closing. Now done before sync.

This commit is contained in:
Thomas Schmitt 2007-10-02 12:06:11 +00:00
parent 72280e9ad3
commit f7a2646e97
2 changed files with 44 additions and 15 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.09.30.212517" #define Cdrskin_timestamP "2007.10.02.120659"

View File

@ -117,7 +117,9 @@ void type_to_form(int mode, unsigned char *ctladr, int *form)
*form |= 0x40; *form |= 0x40;
} }
int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
/* ts A71002 : outsourced from burn_write_flush() : no sync cache here */
int burn_write_flush_buffer(struct burn_write_opts *o,struct burn_track *track)
{ {
struct burn_drive *d = o->drive; struct burn_drive *d = o->drive;
@ -138,13 +140,25 @@ int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
d->buffer->bytes = 0; d->buffer->bytes = 0;
d->buffer->sectors = 0; d->buffer->sectors = 0;
} }
return 1;
}
int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
{
int ret;
struct burn_drive *d = o->drive;
ret = burn_write_flush(o, track);
if (ret <= 0)
return ret;
d->sync_cache(d); d->sync_cache(d);
return 1; return 1;
} }
/* ts A61030 */ /* ts A71002 : outsourced from burn_write_close_track() */
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s, int burn_write_track_minsize(struct burn_write_opts *o, struct burn_session *s,
int tnum) int tnum)
{ {
char msg[81]; char msg[81];
@ -152,11 +166,6 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
struct burn_track *t; struct burn_track *t;
int todo, step, cancelled, seclen; int todo, step, cancelled, seclen;
/* ts A61106 */
#ifdef Libburn_experimental_no_close_tracK
return 1;
#endif
d = o->drive; d = o->drive;
t = s->track[tnum]; t = s->track[tnum];
@ -190,8 +199,26 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
} }
d->cancel = cancelled; d->cancel = cancelled;
} }
return 1;
}
/* ts A61030 */
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
int tnum)
{
char msg[81];
struct burn_drive *d;
struct burn_track *t;
/* ts A61106 */
#ifdef Libburn_experimental_no_close_tracK
return 1;
#endif
d = o->drive;
t = s->track[tnum];
/* ts A61102 */
d->busy = BURN_DRIVE_CLOSING_TRACK; d->busy = BURN_DRIVE_CLOSING_TRACK;
sprintf(msg, "Closing track %2.2d", tnum+1); sprintf(msg, "Closing track %2.2d", tnum+1);
@ -206,13 +233,13 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
*/ */
d->close_track_session(o->drive, 0, 0xff); d->close_track_session(o->drive, 0, 0xff);
/* ts A61102 */
d->busy = BURN_DRIVE_WRITING; d->busy = BURN_DRIVE_WRITING;
return 1; return 1;
} }
/* ts A61030 */ /* ts A61030 */
int burn_write_close_session(struct burn_write_opts *o, struct burn_session *s) int burn_write_close_session(struct burn_write_opts *o, struct burn_session *s)
{ {
@ -811,12 +838,14 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
ex:; ex:;
if (o->write_type == BURN_WRITE_TAO) { if (o->write_type == BURN_WRITE_TAO) {
/* ts A61103 */ /* ts A71002 */
/* >>> if cancelled: ensure that at least 600 kB get written */ if (!burn_write_flush_buffer(o, t))
if (!burn_write_flush(o, t))
ret = 0; ret = 0;
/* Ensure that at least 600 kB get written */
burn_write_track_minsize(o, s, tnum);
d->sync_cache(d);
/* ts A61030 */ /* ts A61030 */
if (burn_write_close_track(o, s, tnum) <= 0) if (burn_write_close_track(o, s, tnum) <= 0)
ret = 0; ret = 0;