Made Xorriso_burn_track() ready for long block adresses

This commit is contained in:
Thomas Schmitt 2024-03-22 17:19:00 +01:00
parent ce3f23b75d
commit f1e00c3e4c
2 changed files with 14 additions and 12 deletions

View File

@ -2275,8 +2275,8 @@ int Xorriso_retry_burn_track(struct XorrisO *xorriso,
int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address, int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
char *track_source, off_t tsize, int flag) char *track_source, off_t tsize, int flag)
{ {
int ret, fd, profile_number, is_cd= 0, dummy, nwa= -1; int ret, fd, profile_number, is_cd= 0, do_isosize, is_bd= 0, signal_mode;
int isosize= -1, do_isosize, is_bd= 0, signal_mode; off_t dummy, nwa= -1, isosize= -1;
struct burn_drive_info *dinfo; struct burn_drive_info *dinfo;
struct burn_drive *drive; struct burn_drive *drive;
struct burn_write_opts *burn_options= NULL; struct burn_write_opts *burn_options= NULL;
@ -2413,7 +2413,7 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
ret= 0; goto ex; ret= 0; goto ex;
} }
/* read isosize from head_buffer, not from medium */ /* read isosize from head_buffer, not from medium */
ret= isoburn_read_iso_head(drive, 0, &isosize, head_buffer, (1<<13)); ret= isoburn_read_iso_head_v2(drive, 0, &isosize, head_buffer, (1 << 13));
if(ret<=0) { if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
@ -2421,9 +2421,10 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex; ret= 0; goto ex;
} }
sprintf(xorriso->info_text, "Size of ISO 9660 image: %ds", isosize); sprintf(xorriso->info_text, "Size of ISO 9660 image: %.fs",
(double) isosize);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
fixed_size= ((off_t) (isosize)) * (off_t) 2048; fixed_size= isosize * (off_t) 2048;
burn_track_set_size(track, fixed_size); burn_track_set_size(track, fixed_size);
} }
@ -2433,7 +2434,7 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
if(isoburn_needs_emulation(drive)) { if(isoburn_needs_emulation(drive)) {
if(flag&1) { if(flag&1) {
ret= isoburn_disc_track_lba_nwa(drive, burn_options, 0, &dummy, &nwa); ret= isoburn_disc_track_lba_nwa_v2(drive, burn_options, 0, &dummy, &nwa);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
if(ret<=0) { if(ret<=0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
@ -2446,7 +2447,8 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
} else { } else {
nwa= 0; nwa= 0;
if (disc_state == BURN_DISC_APPENDABLE) { if (disc_state == BURN_DISC_APPENDABLE) {
ret= isoburn_disc_track_lba_nwa(drive, burn_options, 0, &dummy, &nwa); ret= isoburn_disc_track_lba_nwa_v2(drive, burn_options, 0, &dummy,
&nwa);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
if(ret<=0) { if(ret<=0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
@ -2456,14 +2458,14 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
} }
} }
} }
burn_write_opts_set_start_byte(burn_options,((off_t) nwa) * (off_t) 2048); burn_write_opts_set_start_byte(burn_options, nwa * (off_t) 2048);
} }
if(write_start_address>=0) { if(write_start_address>=0) {
nwa= write_start_address / (off_t) 2048; nwa= write_start_address / (off_t) 2048;
if(((off_t) nwa) * (off_t) 2048 < write_start_address ) if(nwa * (off_t) 2048 < write_start_address )
nwa++; nwa++;
burn_write_opts_set_start_byte(burn_options, ((off_t) nwa) * (off_t) 2048); burn_write_opts_set_start_byte(burn_options, nwa * (off_t) 2048);
} }
if(xorriso->do_tao) { if(xorriso->do_tao) {
@ -2540,7 +2542,7 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
} }
if(flag & 1) { if(flag & 1) {
ret= Xorriso_update_iso_lba0(xorriso, nwa, isosize, head_buffer, NULL, ret= Xorriso_update_iso_lba0(xorriso, (int) nwa, (int) isosize, head_buffer, NULL,
flag & 2); flag & 2);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.03.22.133412" #define Xorriso_timestamP "2024.03.22.161812"