From 707d6153f792fbf6da79712ba4f7af51d3eace34 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 15 Oct 2010 19:17:37 +0000 Subject: [PATCH] Issue warning after writing a BD-R with more than 300 sessions --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/libdax_msgs.h | 2 +- libburn/write.c | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 707fa8a..7b14c9d 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2010.09.28.101043" +#define Cdrskin_timestamP "2010.10.15.191717" diff --git a/libburn/libdax_msgs.h b/libburn/libdax_msgs.h index e34b1fd..18a5002 100644 --- a/libburn/libdax_msgs.h +++ b/libburn/libdax_msgs.h @@ -560,7 +560,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff 0x00020178 (DEBUG,HIGH) = Write thread ended 0x00020179 (FAILURE,HIGH) = Offset source start address is before end of previous source 0x0002017a (FAILURE,HIGH) = Expected offset source object as parameter - + 0x0002017b (WARNING,HIGH) = Sequential BD-R media likely to soon fail writing libdax_audioxtr: 0x00020200 (SORRY,HIGH) = Cannot open audio source file diff --git a/libburn/write.c b/libburn/write.c index 778b7e5..f953ac3 100644 --- a/libburn/write.c +++ b/libburn/write.c @@ -385,9 +385,9 @@ struct cue_sheet *burn_create_toc_entries(struct burn_write_opts *o, runtime = nwa-150; #endif - sheet = malloc(sizeof(struct cue_sheet)); + sheet = calloc(1, sizeof(struct cue_sheet)); - /* ts A61009 : react on failures of malloc(), add_cue_sheet() + /* ts A61009 : react on failures of calloc(), add_cue_sheet() type_to_form() */ if (sheet == NULL) { libdax_msgs_submit(libdax_messenger, -1, 0x00020111, @@ -2006,7 +2006,13 @@ ex:; burn_drive_mark_unready(d); burn_drive_inquire_media(d); - /* <<< d->busy = BURN_DRIVE_IDLE; */ + if (d->current_profile == 0x41 && d->complete_sessions >= 300) { + sprintf(msg, "Sequential BD-R media now contains %d sessions. It is likely to soon fail writing.", d->complete_sessions); + libdax_msgs_submit(libdax_messenger, d->global_index, + 0x0002017b, LIBDAX_MSGS_SEV_WARNING, + LIBDAX_MSGS_PRIO_ZERO, msg, 0, 0); + } + return ret; early_failure:; return 0;