diff --git a/xorriso/write_run.c b/xorriso/write_run.c index cf271bdf..3f3aa42e 100644 --- a/xorriso/write_run.c +++ b/xorriso/write_run.c @@ -98,10 +98,11 @@ int Xorriso_sanitize_image_size(struct XorrisO *xorriso, struct burn_write_opts *burn_options, int flag) { int ret, img_sectors, num_sessions= 0, num_tracks= 0, padding= 0, profile; - int media_space, lba, nwa; + int media_space, lba, nwa, multi_emul_blocks= 0; char profile_name[80]; struct burn_session **sessions; struct burn_track **tracks; + enum burn_disc_status s; img_sectors= burn_disc_get_sectors(disc); @@ -140,6 +141,15 @@ no_track:; sessions survive and confuse -rom_toc_scan. */ xorriso->alignment= 32; + + s= isoburn_disc_get_status(drive); + if(s == BURN_DISC_BLANK) { + /* Count blocks before nwa as part of the image */; + ret= isoburn_disc_track_lba_nwa(drive, burn_options, 0, &lba, &nwa); + if(ret <= 0) + nwa= 0; + multi_emul_blocks= nwa; + } } } if(xorriso->alignment > 0) { @@ -176,7 +186,7 @@ no_track:; {ret= 0; goto ex;} } if(flag&1) { - ret= img_sectors+padding; + ret= multi_emul_blocks + img_sectors + padding; } else ret= 1; ex:; diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 4719525e..138ce0ea 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2010.12.25.094309" +#define Xorriso_timestamP "2010.12.28.093144"