From a4b688ab5218fc6588af611d1bb0c828cd714fb1 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 6 Feb 2017 15:12:41 +0100 Subject: [PATCH] Refusing to write to BD-R if formatted to Pseudo Overwrite --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/libburn.h | 1 + libburn/options.c | 7 ++++++- libburn/write.c | 18 ++++++++++++++++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index ad989b1..62ed9ed 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2017.02.06.135800" +#define Cdrskin_timestamP "2017.02.06.141213" diff --git a/libburn/libburn.h b/libburn/libburn.h index aab9942..2de383b 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -1317,6 +1317,7 @@ int burn_disc_read_atip(struct burn_drive *drive); /** Tells whether a BD-R medium with Pseudo Overwrite (POW) formatting is in the drive. Such a formatting may have been applied by dvd+rw-tools. It prevents sequential multi-session. + libburn will refuse to write to such a medium. @param drive The drive to query. @return 1 if BD-R Pseudo Overwrite , 0 if not BD-R or not POW @since 1.4.8 diff --git a/libburn/options.c b/libburn/options.c index 3f53507..df7f9cc 100644 --- a/libburn/options.c +++ b/libburn/options.c @@ -1,6 +1,6 @@ /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens - Copyright (c) 2006 - 2012 Thomas Schmitt + Copyright (c) 2006 - 2017 Thomas Schmitt Provided under GPL version 2 or later. */ @@ -323,6 +323,11 @@ enum burn_write_types burn_write_opts_auto_write_type( reasons[0] = 0; + if (burn_drive_get_bd_r_pow(d)) { + strcat(reasons, + "MEDIA: unsuitable BD-R Pseudo Overwrite formatting, "); + return BURN_WRITE_NONE; + } if (d->status != BURN_DISC_BLANK && d->status != BURN_DISC_APPENDABLE){ if (d->status == BURN_DISC_FULL) diff --git a/libburn/write.c b/libburn/write.c index 52766ba..0f8aaf5 100644 --- a/libburn/write.c +++ b/libburn/write.c @@ -1,7 +1,7 @@ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens - Copyright (c) 2006 - 2016 Thomas Schmitt + Copyright (c) 2006 - 2017 Thomas Schmitt Provided under GPL version 2 or later. */ @@ -1419,7 +1419,7 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, enum burn_write_types wt; struct burn_drive *d = o->drive; char *msg = NULL, *reason_pt; - int no_media = 0, ret, has_cdtext; + int no_media = 0, ret, has_cdtext, is_bd_pow = 0; reason_pt= reasons; reasons[0] = 0; @@ -1497,6 +1497,20 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, sequential stdio "drive" */ if (o->start_byte >= 0) strcat(reasons, "write start address not supported, "); + + is_bd_pow = burn_drive_get_bd_r_pow(d); + if (is_bd_pow && !silent) + libdax_msgs_submit(libdax_messenger, d->global_index, + 0x0002011e, + LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, + "Unsuitable media detected: BD-R formatted to POW.", + 0, 0); + if (is_bd_pow) { + strcat(reasons, + "unsuitable media formatting POW detected, "); + return 0; + } + } else { unsuitable_profile:; msg = calloc(1, 160);