Made isoburn_set_msc1() ready for long block adresses

This commit is contained in:
Thomas Schmitt 2024-03-10 12:13:20 +01:00
parent aebd2b92ca
commit d0682a17b9
2 changed files with 14 additions and 10 deletions

View File

@ -2102,8 +2102,10 @@ int isoburn_drive_set_msgs_submit(struct burn_drive *d,
int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
int flag)
{
int ret, num_sessions= 0, num_tracks, adr_num, i, j, total_tracks;
int lba, best_lba, size, re_valid= 0, track_count= 0;
int ret, num_sessions= 0, num_tracks, i, j, total_tracks;
int re_valid= 0, track_count= 0;
off_t adr_num, lba, best_lba, size;
double adr_double;
time_t start_time= 0, last_pacifier= 0, now;
char volid[33], *msg= NULL;
struct isoburn *o;
@ -2115,7 +2117,6 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
regex_t re;
regmatch_t match[1];
enum burn_disc_status s;
off_t long_size;
ret= isoburn_find_emulator(&o, d, 0);
if(ret<0)
@ -2128,7 +2129,11 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
{ret= -1; goto ex;}
start_time= last_pacifier= time(NULL);
adr_num= atoi(adr_value);
adr_num= -1;
adr_double= -1.0;
sscanf(adr_value, "%lf", &adr_double);
if(adr_double >= -1.0e16 && adr_double <= 1.0e16) /* ~ 2 exp 53 */
adr_num= adr_double;
if(adr_mode!=3 || (flag & 2)) {
disc= isoburn_toc_drive_get_disc(d);
if(disc==NULL) {
@ -2190,9 +2195,8 @@ not_found:;
}
if((flag & 1) && o->fabricated_msc1 >= 16) {
/* adr_num is possibly 16 blocks too high */
ret= isoburn_read_iso_head_v2(d, o->fabricated_msc1, &long_size, volid,
ret= isoburn_read_iso_head_v2(d, o->fabricated_msc1, &size, volid,
1 | (1 << 14));
size= long_size;
if(ret==2)
o->fabricated_msc1-= 16;
}
@ -2220,12 +2224,12 @@ not_found:;
isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
}
track_count++;
ret= isoburn_toc_track_get_emul(tracks[0], &lba, &size, volid, 0);
ret= isoburn_toc_track_get_emul_v2(tracks[0], &lba, &size, volid, 0);
if(ret < 0)
continue;
if(ret == 0) {
isoburn_get_track_lba(tracks[0], &lba, 0);
ret= isoburn_read_iso_head(d, lba, &size, volid, 1);
isoburn_get_track_lba_v2(tracks[0], &lba, 0);
ret= isoburn_read_iso_head_v2(d, lba, &size, volid, 1);
if(ret<=0)
continue;
}

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.03.10.105732"
#define Xorriso_timestamP "2024.03.10.111205"