diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 61cd620..56ec551 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.02.22.094939" +#define Cdrskin_timestamP "2007.02.22.113016" diff --git a/libburn/drive.c b/libburn/drive.c index 8ef0cae..9c7619e 100644 --- a/libburn/drive.c +++ b/libburn/drive.c @@ -1445,12 +1445,18 @@ off_t burn_disc_available_space(struct burn_drive *d, int lba, nwa; if (burn_drive_is_released(d)) - return d->media_capacity_remaining; + goto ex; if (d->busy != BURN_DRIVE_IDLE) - return d->media_capacity_remaining; + goto ex; if (o != NULL) d->send_write_parameters(d, o); d->get_nwa(d, -1, &lba, &nwa); +ex:; + if (o->start_byte > 0) { + if (o->start_byte > d->media_capacity_remaining) + return 0; + return d->media_capacity_remaining - o->start_byte; + } return d->media_capacity_remaining; } diff --git a/libburn/libburn.h b/libburn/libburn.h index 06cdf45..8e273a0 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -847,6 +847,9 @@ int burn_disc_get_msc1(struct burn_drive *d, int *start_lba); inquiring the space with such a set of options, the drive has to be grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value from the most recent automatic inquiry (e.g. during last drive grabbing). + An eventual start address from burn_write_opts_set_start_byte() will be + subtracted from the obtained capacity estimation. Negative results get + defaulted to 0. @param d The drive to query. @param o If not NULL: write parameters to be set on drive before query @return number of most probably available free bytes