From 9180a0036d3544348ed7300e92a95489a583289c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 14 Jan 2007 13:41:19 +0000 Subject: [PATCH] Avoided closing of 0x13-DVD-RW sessions which are not intermediate --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/mmc.c | 12 ++++++++---- libburn/transport.h | 4 ++++ libburn/write.c | 8 +++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index d4c9256..d3a4980 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.01.14.115347" +#define Cdrskin_timestamP "2007.01.14.133951" diff --git a/libburn/mmc.c b/libburn/mmc.c index 58fdf8b..4b02b7b 100644 --- a/libburn/mmc.c +++ b/libburn/mmc.c @@ -1409,10 +1409,12 @@ selected_not_suitable:; if (d->best_format_size <= 0) return 1; } else { - /* formatted or intermediate state ? */ - if (d->format_descr_type == 2 || - d->format_descr_type == 3) + if (d->format_descr_type == 2) /* formatted */ return 1; + if (d->format_descr_type == 3){/*intermediate*/ + d->dvd_minus_rw_incomplete = 1; + return 1; + } /* does trying make sense at all ? */ tolerate_failure = 1; } @@ -1507,7 +1509,8 @@ unsuitable_media:; msg, 0, 0); } return 0; - } + } else if ((!c.error) && (format_type == 0x13 || format_type == 0x15)) + d->dvd_minus_rw_incomplete = 1; if (return_immediately) return 1; usleep(1000000); /* there seems to be a little race condition */ @@ -1667,6 +1670,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->bg_format_status = -1; d->num_format_descr = 0; diff --git a/libburn/transport.h b/libburn/transport.h index ba8e404..a906007 100644 --- a/libburn/transport.h +++ b/libburn/transport.h @@ -152,6 +152,10 @@ struct burn_drive int current_is_cd_profile; int current_is_supported_profile; + /* ts A70114 : wether a DVD-RW media holds an incomplete session + (which could need closing after write) */ + int dvd_minus_rw_incomplete; + /* ts A61218 from 46h GET CONFIGURATION */ int bg_format_status; /* 0=needs format start, 1=needs format restart*/ diff --git a/libburn/write.c b/libburn/write.c index f596a90..a233d0c 100644 --- a/libburn/write.c +++ b/libburn/write.c @@ -925,9 +925,11 @@ int burn_dvd_write_session(struct burn_write_opts *o, return 0; } else if (d->current_profile == 0x13) { /* DVD-RW restricted overwrite */ - ret = burn_disc_close_session_dvd_minus_rw(o, s); - if (ret <= 0) - return 0; + if (d->dvd_minus_rw_incomplete) { + ret = burn_disc_close_session_dvd_minus_rw(o, s); + if (ret <= 0) + return 0; + } } else if (d->current_profile == 0x12) { /* DVD-RAM */ /* ??? any finalization needed ? */;