Made isoburn_welcome_media() ready for large block adresses
This commit is contained in:
parent
fbeec724d7
commit
aebd2b92ca
@ -362,7 +362,7 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
|
|||||||
enum burn_disc_status s;
|
enum burn_disc_status s;
|
||||||
|
|
||||||
#ifndef Hardcoded_cd_rW
|
#ifndef Hardcoded_cd_rW
|
||||||
int lba, nwa;
|
off_t lba, nwa;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
s= burn_disc_get_status(d);
|
s= burn_disc_get_status(d);
|
||||||
@ -505,7 +505,7 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
|
|||||||
#ifdef Hardcoded_cd_rW
|
#ifdef Hardcoded_cd_rW
|
||||||
(*o)->nwa= Hardcoded_cd_rw_nwA;
|
(*o)->nwa= Hardcoded_cd_rw_nwA;
|
||||||
#else
|
#else
|
||||||
ret= burn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
|
ret= burn_disc_track_lba_nwa_v2(d, NULL, 0, &lba, &nwa);
|
||||||
if(ret>0)
|
if(ret>0)
|
||||||
(*o)->nwa= nwa;
|
(*o)->nwa= nwa;
|
||||||
if((*o)->nwa < (*o)->zero_nwa)
|
if((*o)->nwa < (*o)->zero_nwa)
|
||||||
@ -1433,8 +1433,8 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int isoburn_make_toc_entry(struct isoburn *o, int *session_count, int lba,
|
int isoburn_make_toc_entry(struct isoburn *o, int *session_count, off_t lba,
|
||||||
int track_blocks, char *volid, int flag)
|
off_t track_blocks, char *volid, int flag)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct isoburn_toc_entry *item;
|
struct isoburn_toc_entry *item;
|
||||||
@ -1471,9 +1471,10 @@ no_memory:;
|
|||||||
*/
|
*/
|
||||||
int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
||||||
{
|
{
|
||||||
int ret, image_size= 0, lba, track_blocks, session_count= 0, read_flag= 0;
|
int ret, session_count= 0, read_flag= 0;
|
||||||
int scan_start= 0, scan_count= 0, probe_minus_16= 0, growisofs_nwa, role;
|
int probe_minus_16= 0, role, with_enclosure= 0;
|
||||||
int with_enclosure= 0, readable_blocks= -1;
|
off_t image_size= 0, lba, track_blocks, scan_start= 0, scan_count= 0;
|
||||||
|
off_t growisofs_nwa, readable_blocks= -1;
|
||||||
struct isoburn *o;
|
struct isoburn *o;
|
||||||
char *msg= NULL, *size_text= NULL, *sev, volid[33], *volid_pt= NULL;
|
char *msg= NULL, *size_text= NULL, *sev, volid[33], *volid_pt= NULL;
|
||||||
time_t start_time, last_pacifier, now;
|
time_t start_time, last_pacifier, now;
|
||||||
@ -1492,13 +1493,13 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|||||||
if(o->emulation_mode<=0 && !(flag&1))
|
if(o->emulation_mode<=0 && !(flag&1))
|
||||||
{ret= 0; goto ex;}
|
{ret= 0; goto ex;}
|
||||||
|
|
||||||
ret= burn_get_read_capacity(d, &readable_blocks, 0);
|
ret= burn_get_read_capacity_v2(d, &readable_blocks, 0);
|
||||||
if(ret <= 0) {
|
if(ret <= 0) {
|
||||||
role = burn_drive_get_drive_role(d);
|
role = burn_drive_get_drive_role(d);
|
||||||
if (role == 2 || role == 4)
|
if (role == 2 || role == 4)
|
||||||
/* Might be a block device on a system where libburn cannot determine its
|
/* Might be a block device on a system where libburn cannot determine its
|
||||||
size. Try to read anyway. */
|
size. Try to read anyway. */
|
||||||
readable_blocks= 0x7ffffff0; /* try to read anyway */
|
readable_blocks= 0x7fffffffffffffff; /* try to read anyway */
|
||||||
else
|
else
|
||||||
readable_blocks= -1;
|
readable_blocks= -1;
|
||||||
}
|
}
|
||||||
@ -1509,11 +1510,11 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|||||||
lba= 0;
|
lba= 0;
|
||||||
if(flag & 2) {
|
if(flag & 2) {
|
||||||
/* If there is a PVD at LBA 32 then this is an image with emulated TOC */
|
/* If there is a PVD at LBA 32 then this is an image with emulated TOC */
|
||||||
ret= isoburn_read_iso_head(d, 32, &image_size, NULL, 0);
|
ret= isoburn_read_iso_head_v2(d, 32, &image_size, NULL, 0);
|
||||||
if(ret > 0)
|
if(ret > 0)
|
||||||
lba= 32;
|
lba= 32;
|
||||||
} else {
|
} else {
|
||||||
ret= isoburn_read_iso_head(d, lba, &image_size, NULL, 0);
|
ret= isoburn_read_iso_head_v2(d, lba, &image_size, NULL, 0);
|
||||||
if(ret<=0)
|
if(ret<=0)
|
||||||
{ret= 0; goto failure;}
|
{ret= 0; goto failure;}
|
||||||
lba= o->target_iso_head_size / 2048;
|
lba= o->target_iso_head_size / 2048;
|
||||||
@ -1553,7 +1554,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|||||||
probe_minus_16= 0;
|
probe_minus_16= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret= isoburn_read_iso_head(d, lba, &track_blocks, volid, read_flag);
|
ret= isoburn_read_iso_head_v2(d, lba, &track_blocks, volid, read_flag);
|
||||||
if(ret > 0) {
|
if(ret > 0) {
|
||||||
volid_pt= volid;
|
volid_pt= volid;
|
||||||
} else {
|
} else {
|
||||||
@ -1570,8 +1571,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sprintf(msg,
|
sprintf(msg,
|
||||||
"Chain of ISO session headers broken at #%d, LBA %ds",
|
"Chain of ISO session headers broken at #%d, LBA %.fs",
|
||||||
session_count+1, lba);
|
session_count+1, (double) lba);
|
||||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
||||||
|
|
||||||
if(with_enclosure) {
|
if(with_enclosure) {
|
||||||
@ -1588,8 +1589,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|||||||
lba-= 16;
|
lba-= 16;
|
||||||
|
|
||||||
if(readable_blocks >= 0 && lba + track_blocks > readable_blocks) {
|
if(readable_blocks >= 0 && lba + track_blocks > readable_blocks) {
|
||||||
sprintf(msg, "ISO image size %ds larger than readable size %ds",
|
sprintf(msg, "ISO image size %.fs larger than readable size %.fs",
|
||||||
lba + track_blocks, readable_blocks);
|
(double) (lba + track_blocks), (double) readable_blocks);
|
||||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
||||||
track_blocks= readable_blocks - lba;
|
track_blocks= readable_blocks - lba;
|
||||||
}
|
}
|
||||||
@ -1627,8 +1628,8 @@ failure:;
|
|||||||
isoburn_toc_entry_destroy(&(o->toc), 1);
|
isoburn_toc_entry_destroy(&(o->toc), 1);
|
||||||
if(with_enclosure && o->emulation_mode == 1) {
|
if(with_enclosure && o->emulation_mode == 1) {
|
||||||
if(readable_blocks >= 0 && image_size > readable_blocks) {
|
if(readable_blocks >= 0 && image_size > readable_blocks) {
|
||||||
sprintf(msg, "ISO image size %ds larger than readable size %ds",
|
sprintf(msg, "ISO image size %.fs larger than readable size %.fs",
|
||||||
image_size, readable_blocks);
|
(double) image_size, (double) readable_blocks);
|
||||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
||||||
image_size= readable_blocks;
|
image_size= readable_blocks;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2024.03.10.101203"
|
#define Xorriso_timestamP "2024.03.10.105732"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user