From 87576c3dfcbef1f05fa8c3c0a9590de985583621 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 18 Jan 2007 21:18:03 +0000 Subject: [PATCH] Kept DVD+RW from stopping BG formatting if it was not started at all --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/mmc.c | 8 +++++--- libburn/trunk/libburn/transport.h | 2 +- libburn/trunk/libburn/write.c | 12 ++++++++---- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index c2b53fb8..1445c65e 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.01.16.151041" +#define Cdrskin_timestamP "2007.01.18.211740" diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index 4b02b7b6..49001b58 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -255,6 +255,8 @@ void mmc_close(struct burn_drive *d, int session, int track) /* ts A61030 : shifted !!session rather than or-ing plain session */ c.opcode[2] = ((!!session)<<1) | !!track; + fprintf(stderr, "LIBBURN_DEBUG: mmc_close %d\n", c.opcode[2]); + c.opcode[4] = track >> 8; c.opcode[5] = track & 0xFF; c.page = NULL; @@ -1412,7 +1414,7 @@ selected_not_suitable:; if (d->format_descr_type == 2) /* formatted */ return 1; if (d->format_descr_type == 3){/*intermediate*/ - d->dvd_minus_rw_incomplete = 1; + d->needs_close_session = 1; return 1; } /* does trying make sense at all ? */ @@ -1510,7 +1512,7 @@ unsuitable_media:; } return 0; } else if ((!c.error) && (format_type == 0x13 || format_type == 0x15)) - d->dvd_minus_rw_incomplete = 1; + d->needs_close_session = 1; if (return_immediately) return 1; usleep(1000000); /* there seems to be a little race condition */ @@ -1670,7 +1672,7 @@ int mmc_setup_drive(struct burn_drive *d) d->current_profile_text[0] = 0; d->current_is_cd_profile = 0; d->current_is_supported_profile = 0; - d->dvd_minus_rw_incomplete = 0; + d->needs_close_session = 0; d->bg_format_status = -1; d->num_format_descr = 0; diff --git a/libburn/trunk/libburn/transport.h b/libburn/trunk/libburn/transport.h index a906007d..ec46d9bd 100644 --- a/libburn/trunk/libburn/transport.h +++ b/libburn/trunk/libburn/transport.h @@ -154,7 +154,7 @@ struct burn_drive /* ts A70114 : wether a DVD-RW media holds an incomplete session (which could need closing after write) */ - int dvd_minus_rw_incomplete; + int needs_close_session; /* ts A61218 from 46h GET CONFIGURATION */ int bg_format_status; /* 0=needs format start, 1=needs format restart*/ diff --git a/libburn/trunk/libburn/write.c b/libburn/trunk/libburn/write.c index a233d0cc..d96603d5 100644 --- a/libburn/trunk/libburn/write.c +++ b/libburn/trunk/libburn/write.c @@ -920,12 +920,14 @@ int burn_dvd_write_session(struct burn_write_opts *o, } if (d->current_profile == 0x1a) { /* DVD+RW */ - ret = burn_disc_close_session_dvd_plus_rw(o, s); - if (ret <= 0) - return 0; + if (d->needs_close_session) { + ret = burn_disc_close_session_dvd_plus_rw(o, s); + if (ret <= 0) + return 0; + } } else if (d->current_profile == 0x13) { /* DVD-RW restricted overwrite */ - if (d->dvd_minus_rw_incomplete) { + if (d->needs_close_session) { ret = burn_disc_close_session_dvd_minus_rw(o, s); if (ret <= 0) return 0; @@ -953,6 +955,7 @@ int burn_disc_setup_dvd_plus_rw(struct burn_write_opts *o, if (ret <= 0) return 0; d->busy = BURN_DRIVE_WRITING; + d->needs_close_session = 1; } d->nwa = 0; if (o->start_byte >= 0) { @@ -1047,6 +1050,7 @@ int burn_dvd_write_sync(struct burn_write_opts *o, struct burn_drive *d = o->drive; char msg[160]; + d->needs_close_session = 0; for (sx = 0; sx < disc->sessions; sx++) for (tx = 0 ; tx < disc->session[sx]->tracks; tx++) { mode = disc->session[sx]->track[tx]->mode;