On Thursday, 25. October 2001 20:40, you wrote:
As far as I can tell, after a full blank, cdrwtool gets given the size of the disc in real, physical blocks (approx 336000). After a quick blank, though, the drive reports the size in available blocks for packet-writing (ie. around 275000 or so).
We have had the discussion before, the number is drive dependant. Some drives give the cooked size for even unformatted tracks in packet writing mode, most others only for packet-formatted tracks.
Could you perhaps use the ATIP start of lead-out information or something? This is still correctly reported (by cdrecord). I think it should be enough to take it from disc_info, so we need not have a new structure in cdrwtool. Unfortunately, I can't get any recorder to work right now, but I suspect that something along the lines of the untested patch below should work for all recorders.
Arnd <>< --- cdrwtool.c-orig Thu Oct 25 12:52:04 2001 +++ cdrwtool.c Fri Oct 26 01:18:32 2001 @@ -669,7 +675,7 @@ int quick_setup(options_t *o) { - track_info_t ti; + disc_info_t di; int ret; unsigned blocks; mkudf_options opt; @@ -688,21 +694,17 @@ printf("Initiating quick disc blank\n"); - if ((ret = read_track_info(&ti, 1)) < 0) + if ((ret = read_disc_info(&di)) < 0) return ret; - blocks = be32_to_cpu(ti.track_size); - if (o->fpacket && !(ti.packet && ti.fp)) - { - /* fixed packets format usable blocks */ - blocks = ((blocks + 7) / (o->packet_size + 7)) * o->packet_size; - } + blocks = be32_to_cpu(di.lead_out); + blocks = ((blocks + 7) / (o->packet_size + 7)) * o->packet_size; printf("Disc capacity is %u blocks (%uKB/%uMB)\n", blocks, blocks * 2, blocks / 512); memset(&opt, 0x00, sizeof(mkudf_options)); if (o->fpacket) {