Refusing to write to BD-R if formatted to Pseudo Overwrite

This commit is contained in:
Thomas Schmitt 2017-02-06 15:12:41 +01:00
parent d71d80d1a1
commit a4b688ab52
4 changed files with 24 additions and 4 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2017.02.06.135800"
#define Cdrskin_timestamP "2017.02.06.141213"

View File

@ -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

View File

@ -1,6 +1,6 @@
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2012 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2006 - 2017 Thomas Schmitt <scdbackup@gmx.net>
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)

View File

@ -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 <scdbackup@gmx.net>
Copyright (c) 2006 - 2017 Thomas Schmitt <scdbackup@gmx.net>
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);