From 649f67697afcb8fe145b6ce1ce8d6f73c1eef1f4 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 30 Mar 2007 20:11:36 +0000 Subject: [PATCH] Allowed finalizing of DVD+R --- cdrskin/cdrskin.1 | 10 ++----- cdrskin/cdrskin_timestamp.h | 2 +- libburn/write.c | 60 +++++++++++++++++++++---------------- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/cdrskin/cdrskin.1 b/cdrskin/cdrskin.1 index 1365fde..dd2e3c0 100644 --- a/cdrskin/cdrskin.1 +++ b/cdrskin/cdrskin.1 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH CDRSKIN 1 "March 28, 2007" +.TH CDRSKIN 1 "March 30, 2007" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -190,12 +190,6 @@ DVD+R. Quite deliberately write mode -sao insists in the tradition of a predicted track size and blank media, whereas -tao writes the tracks open ended and allows appendable media. -.br -Currently DVD+R are always kept appendable regardless wether -multi is given -or not. This might change in future so it is strongly advised to already now -use -.B -multi -whenever the disc shall be kept appendable. .PP .B Overwriteable DVD Media: .br @@ -418,7 +412,7 @@ If not, then the burn run will be aborted. .br The range of -isosize is exactly one track. Further tracks may be preceeded by further -isosize options, though. At least 15 blocks of padding will be -added to each -isosize track. But be advised to use padsize=300k. +added to each -isosize track. But be advised to rather use padsize=300k. .br This option can be performed on track sources which are regular files or block devices. For the first track of the session it can be performed on any type diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index db0d36b..a72fcc3 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.03.28.202802" +#define Cdrskin_timestamP "2007.03.30.201034" diff --git a/libburn/write.c b/libburn/write.c index 627fcac..4df7ed9 100644 --- a/libburn/write.c +++ b/libburn/write.c @@ -1075,9 +1075,31 @@ int burn_disc_close_track_dvd_minus_r(struct burn_write_opts *o, } +/* ts A70229 */ +int burn_disc_finalize_dvd_plus_r(struct burn_write_opts *o) +{ + struct burn_drive *d = o->drive; + + libdax_msgs_submit(libdax_messenger, d->global_index, + 0x00000002, + LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, + "Finalizing DVD+R ...", 0, 0); + + /* CLOSE SESSION, 101b, Finalize with minimal radius */ + d->close_track_session(d, 2, 1); /* (2<<1)|1 = 5 */ + + libdax_msgs_submit(libdax_messenger, d->global_index, + 0x00000002, + LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, + "... finalizing DVD+R done ", 0, 0); + + return 1; +} + + /* ts A70226 */ int burn_disc_close_track_dvd_plus_r(struct burn_write_opts *o, - struct burn_session *s, int tnum) + struct burn_session *s, int tnum, int is_last_track) { struct burn_drive *d = o->drive; char msg[80]; @@ -1093,8 +1115,11 @@ int burn_disc_close_track_dvd_plus_r(struct burn_write_opts *o, /* Each session becomes a single logical track. So to distinguish them, it is mandatory to close the session together with each track. */ - d->close_track_session(d, 1, 0); /* CLOSE SESSION, 010b */ + if (is_last_track && !o->multi) + burn_disc_finalize_dvd_plus_r(o); + else + d->close_track_session(d, 1, 0); /* CLOSE SESSION, 010b */ d->busy = BURN_DRIVE_WRITING; d->last_track_no++; return 1; @@ -1103,7 +1128,7 @@ int burn_disc_close_track_dvd_plus_r(struct burn_write_opts *o, /* ts A61218 - A70129 */ int burn_dvd_write_track(struct burn_write_opts *o, - struct burn_session *s, int tnum) + struct burn_session *s, int tnum, int is_last_track) { struct burn_track *t = s->track[tnum]; struct burn_drive *d = o->drive; @@ -1189,7 +1214,8 @@ int burn_dvd_write_track(struct burn_write_opts *o, goto ex; } else if (d->current_profile == 0x1b || d->current_profile == 0x2b) { /* DVD+R , DVD+R/DL */ - ret = burn_disc_close_track_dvd_plus_r(o, s, tnum); + ret = burn_disc_close_track_dvd_plus_r(o, s, tnum, + is_last_track); if (ret <= 0) goto ex; } @@ -1268,7 +1294,7 @@ int burn_disc_close_session_dvd_minus_r(struct burn_write_opts *o, /* ts A61218 */ int burn_dvd_write_session(struct burn_write_opts *o, - struct burn_session *s) + struct burn_session *s, int is_last_session) { int i,ret; struct burn_drive *d = o->drive; @@ -1276,7 +1302,8 @@ int burn_dvd_write_session(struct burn_write_opts *o, /* >>> open_session ? */ for (i = 0; i < s->tracks; i++) { - ret = burn_dvd_write_track(o, s, i); + ret = burn_dvd_write_track(o, s, i, + is_last_session && i == (s->tracks - 1)); if (ret <= 0) break; } @@ -1428,24 +1455,6 @@ int burn_disc_setup_dvd_plus_r(struct burn_write_opts *o, } -/* ts A70229 */ -int burn_disc_finalize_dvd_plus_r(struct burn_write_opts *o) -{ - struct burn_drive *d = o->drive; - - /* <<< FOR NOW: avoid finalizing media */ - return 3; - - if (o->multi) - return 2; - d->busy = BURN_DRIVE_CLOSING_SESSION; - /* CLOSE SESSION, 101b, Finalize with minimal radius */ - d->close_track_session(d, 2, 1); /* (2<<1)|1 = 5 */ - d->busy = BURN_DRIVE_WRITING; - return 1; -} - - /* ts A61218 - A70129 */ int burn_dvd_write_sync(struct burn_write_opts *o, struct burn_disc *disc) @@ -1700,7 +1709,8 @@ int burn_dvd_write_sync(struct burn_write_opts *o, d->progress.session = i; d->progress.tracks = disc->session[i]->tracks; - ret = burn_dvd_write_session(o, disc->session[i]); + ret = burn_dvd_write_session(o, disc->session[i], + i == (disc->sessions - 1)); if (ret <= 0) goto ex;