diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index b957beb..cac992e 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2021.09.02.181259" +#define Cdrskin_timestamP "2021.09.12.084139" diff --git a/libburn/libburn.h b/libburn/libburn.h index 99b8dc4..478dee3 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -3389,6 +3389,21 @@ void burn_write_opts_set_dvd_obs(struct burn_write_opts *opts, int obs); void burn_write_opts_set_obs_pad(struct burn_write_opts *opts, int pad); +/* ts C10909 */ +/** Exempts BD-R media from the elsewise unavoidable automatic padding of the + last write chunk to its full size. + Even if this exempt is granted it gets into effect only if stream recording + is disabled and burn_write_opts_set_obs_pad() is set to 0. + @param opts The write opts to change + @param value 1= possibly exempt BD-R from end chunk padding. + 0= always act on BD-R as if + burn_write_opts_set_obs_pad(opts, 1) is in effect. + @since 1.5.6 +*/ +void burn_write_opts_set_bdr_obs_exempt(struct burn_write_opts *opts, + int value); + + /* ts A91115 */ /** Sets the rhythm by which stdio pseudo drives force their output data to be consumed by the receiving storage device. This forcing keeps the memory diff --git a/libburn/libburn.ver b/libburn/libburn.ver index 44c7508..7a52e5e 100644 --- a/libburn/libburn.ver +++ b/libburn/libburn.ver @@ -186,6 +186,7 @@ burn_write_opts_auto_write_type; burn_write_opts_free; burn_write_opts_get_drive; burn_write_opts_new; +burn_write_opts_set_bdr_obs_exempt; burn_write_opts_set_dvd_obs; burn_write_opts_set_fail21h_sev; burn_write_opts_set_fillup; diff --git a/libburn/options.c b/libburn/options.c index 4663d26..19c98b6 100644 --- a/libburn/options.c +++ b/libburn/options.c @@ -55,6 +55,7 @@ struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive) opts->obs_pad = 0; #endif + opts->bdr_obs_exempt = 0; opts->start_byte = -1; opts->fill_up_media = 0; opts->force_is_set = 0; @@ -535,6 +536,14 @@ void burn_write_opts_set_obs_pad(struct burn_write_opts *opts, int pad) } +/* ts C10909: API */ +void burn_write_opts_set_bdr_obs_exempt(struct burn_write_opts *opts, + int value) +{ + opts->bdr_obs_exempt = !!value; +} + + /* ts A91115: API */ void burn_write_opts_set_stdio_fsync(struct burn_write_opts *opts, int rhythm) { diff --git a/libburn/options.h b/libburn/options.h index 228d072..afebe81 100644 --- a/libburn/options.h +++ b/libburn/options.h @@ -46,6 +46,9 @@ struct burn_write_opts 2 indicates burn_write_opts_set_obs_pad(,1) */ + /* 1= do not apply obs_pad=1 to BD-R if not stream recording. */ + int bdr_obs_exempt; + /* ts A61222 : Start address for media which offer a choice */ off_t start_byte; diff --git a/libburn/write.c b/libburn/write.c index 55e6578..8c86769 100644 --- a/libburn/write.c +++ b/libburn/write.c @@ -1658,16 +1658,6 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o, size += (off_t) (o->obs - (size % o->obs)); } - /* <<< Only for now until the first DVD+R succeeded */ - if (!o->obs_pad) { - sprintf(msg, "Program error: encountered DVD+R without chunk padding"); - libdax_msgs_submit(libdax_messenger, d->global_index, - 0x00000004, - LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, - msg, 0, 0); - {ret = 0; goto ex;} - } - ret = d->reserve_track(d, size); if (ret <= 0) { sprintf(msg, "Cannot reserve track of %.f bytes", @@ -2436,9 +2426,17 @@ int burn_dvd_write_sync(struct burn_write_opts *o, msg, 0, 0); goto early_failure; } - /* ??? padding needed ??? cowardly doing it for now */ - if (o->obs_pad < 2) + /* Unaligned BD-R track end works with various drives and + produces exact READ CAPACITY results. + Nevertheless stream recording hates unaligned WRITE. + With DVD+R it seems that obs_pad is silently applied by the + drive if a non-aligned final WRITE is received. + */ + if (o->obs_pad < 2 && + !(d->current_profile == 0x41 && !d->do_stream_recording && + o->bdr_obs_exempt)) o->obs_pad = 1; /* fill-up track's last obs buffer */ + if (d->current_profile == 0x41) /* BD-R */ o->obs = Libburn_bd_r_obS; if (d->do_stream_recording) {