Burning DVD-R DAO with 2 kB size granularity rather than 32 kB

This commit is contained in:
2011-03-12 09:35:04 +00:00
parent b945974dc7
commit 1b166f484d
3 changed files with 15 additions and 8 deletions

View File

@ -347,9 +347,10 @@ int mmc_reserve_track(struct burn_drive *d, off_t size)
memcpy(c.opcode, MMC_RESERVE_TRACK, sizeof(MMC_RESERVE_TRACK));
*/
c.retry = 1;
/* Round to 32 KiB and divide by 2048
(by nice binary rounding trick learned from dvd+rw-tools) */
lba = ((size + (off_t) 0x7fff) >> 11) & ~0xf;
lba = size / 2048;
if (size % 2048)
lba++;
mmc_int_to_four_char(c.opcode+5, lba);
sprintf(msg, "reserving track of %d blocks", lba);