Made structs SpotlistiteM and SpotlisT ready for long block adresses
This commit is contained in:
parent
86261b7972
commit
ba12014d46
@ -39,14 +39,14 @@
|
|||||||
|
|
||||||
|
|
||||||
struct SpotlistiteM {
|
struct SpotlistiteM {
|
||||||
int start_lba;
|
off_t start_lba;
|
||||||
int blocks;
|
off_t blocks;
|
||||||
int quality;
|
int quality;
|
||||||
struct SpotlistiteM *next;
|
struct SpotlistiteM *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int Spotlistitem_new(struct SpotlistiteM **o, int start_lba, int blocks,
|
int Spotlistitem_new(struct SpotlistiteM **o, off_t start_lba, off_t blocks,
|
||||||
int quality, int flag)
|
int quality, int flag)
|
||||||
{
|
{
|
||||||
struct SpotlistiteM *m;
|
struct SpotlistiteM *m;
|
||||||
@ -76,9 +76,9 @@ int Spotlistitem_destroy(struct SpotlistiteM **o, int flag)
|
|||||||
struct SpotlisT {
|
struct SpotlisT {
|
||||||
struct SpotlistiteM *list_start;
|
struct SpotlistiteM *list_start;
|
||||||
struct SpotlistiteM *list_end;
|
struct SpotlistiteM *list_end;
|
||||||
int list_count;
|
off_t list_count;
|
||||||
struct SpotlistiteM *current_item;
|
struct SpotlistiteM *current_item;
|
||||||
int current_idx;
|
off_t current_idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ int Spotlist_destroy(struct SpotlisT **o, int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
|
int Spotlist_add_item(struct SpotlisT *o, off_t start_lba, off_t blocks,
|
||||||
int quality, int flag)
|
int quality, int flag)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
@ -135,8 +135,9 @@ int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
|
|||||||
(o->list_count)++;
|
(o->list_count)++;
|
||||||
|
|
||||||
if(debug_verbous) {char quality_name[80];
|
if(debug_verbous) {char quality_name[80];
|
||||||
fprintf(stderr, "debug: lba %10d , size %10d , quality '%s'\n",
|
fprintf(stderr, "debug: lba %10.f , size %10.f , quality '%s'\n",
|
||||||
start_lba, blocks, Spotlist__quality_name(quality, quality_name,
|
(double) start_lba, (double) blocks,
|
||||||
|
Spotlist__quality_name(quality, quality_name,
|
||||||
Xorriso_read_quality_invaliD, 0) + 2);
|
Xorriso_read_quality_invaliD, 0) + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,15 +145,15 @@ int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Spotlist_count(struct SpotlisT *o, int flag)
|
off_t Spotlist_count(struct SpotlisT *o, int flag)
|
||||||
{
|
{
|
||||||
return o->list_count;
|
return o->list_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Spotlist_block_count(struct SpotlisT *o, int flag)
|
off_t Spotlist_block_count(struct SpotlisT *o, int flag)
|
||||||
{
|
{
|
||||||
int list_blocks= 0;
|
off_t list_blocks= 0;
|
||||||
struct SpotlistiteM *li;
|
struct SpotlistiteM *li;
|
||||||
|
|
||||||
for(li= o->list_start; li != NULL; li= li->next) {
|
for(li= o->list_start; li != NULL; li= li->next) {
|
||||||
@ -163,9 +164,9 @@ int Spotlist_block_count(struct SpotlisT *o, int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag)
|
off_t Spotlist_sector_size(struct SpotlisT *o, off_t read_chunk, int flag)
|
||||||
{
|
{
|
||||||
int sector_size;
|
off_t sector_size;
|
||||||
struct SpotlistiteM *li;
|
struct SpotlistiteM *li;
|
||||||
|
|
||||||
sector_size= read_chunk * 2048;
|
sector_size= read_chunk * 2048;
|
||||||
@ -179,10 +180,10 @@ int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Spotlist_get_item(struct SpotlisT *o, int idx,
|
int Spotlist_get_item(struct SpotlisT *o, off_t idx,
|
||||||
int *start_lba, int *blocks, int *quality, int flag)
|
off_t *start_lba, off_t *blocks, int *quality, int flag)
|
||||||
{
|
{
|
||||||
int i;
|
off_t i;
|
||||||
struct SpotlistiteM *li;
|
struct SpotlistiteM *li;
|
||||||
|
|
||||||
if(idx < 0 || idx > o->list_count)
|
if(idx < 0 || idx > o->list_count)
|
||||||
@ -996,7 +997,7 @@ int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso,
|
|||||||
if(value == old_value)
|
if(value == old_value)
|
||||||
continue;
|
continue;
|
||||||
if(old_value >= 0) {
|
if(old_value >= 0) {
|
||||||
ret= Spotlist_add_item(*spotlist, (int) old_start, (int) (i * sector_size - old_start),
|
ret= Spotlist_add_item(*spotlist, old_start, i * sector_size - old_start,
|
||||||
(old_value ? Xorriso_read_quality_valiD :
|
(old_value ? Xorriso_read_quality_valiD :
|
||||||
Xorriso_read_quality_invaliD), 0);
|
Xorriso_read_quality_invaliD), 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
@ -1007,8 +1008,8 @@ int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso,
|
|||||||
job->item_limit);
|
job->item_limit);
|
||||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||||
if(sectors - i > 1) {
|
if(sectors - i > 1) {
|
||||||
ret= Spotlist_add_item(*spotlist, (int) (i * sector_size),
|
ret= Spotlist_add_item(*spotlist, i * sector_size,
|
||||||
(int) ((sectors - i - 1) * sector_size),
|
(sectors - i - 1) * sector_size,
|
||||||
Xorriso_read_quality_untesteD, 0);
|
Xorriso_read_quality_untesteD, 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
@ -1020,7 +1021,7 @@ int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso,
|
|||||||
old_start= i * sector_size;
|
old_start= i * sector_size;
|
||||||
}
|
}
|
||||||
if(old_value >= 0) {
|
if(old_value >= 0) {
|
||||||
ret= Spotlist_add_item(*spotlist, (int) old_start, (int) (i * sector_size - old_start),
|
ret= Spotlist_add_item(*spotlist, old_start, i * sector_size - old_start,
|
||||||
(old_value ? Xorriso_read_quality_valiD :
|
(old_value ? Xorriso_read_quality_valiD :
|
||||||
Xorriso_read_quality_invaliD), 0);
|
Xorriso_read_quality_invaliD), 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
@ -1039,15 +1040,16 @@ ex:;
|
|||||||
*/
|
*/
|
||||||
int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
|
int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
|
||||||
struct SpotlisT *spotlist,
|
struct SpotlisT *spotlist,
|
||||||
int read_chunk,
|
off_t read_chunk,
|
||||||
struct SectorbitmaP **map,
|
struct SectorbitmaP **map,
|
||||||
int flag)
|
int flag)
|
||||||
{
|
{
|
||||||
struct SectorbitmaP *m;
|
struct SectorbitmaP *m;
|
||||||
int valid;
|
int valid;
|
||||||
off_t map_sectors= -1, map_sector_size= -1;
|
off_t map_sectors= -1, map_sector_size= -1;
|
||||||
int list_sectors, list_blocks, sector_size, sector_blocks;
|
int replace_map= 0, quality, ret, pass;
|
||||||
int replace_map= 0, count, i, lba, blocks, quality, ret, pass;
|
off_t list_sectors, list_blocks, sector_size, sector_blocks;
|
||||||
|
off_t count, i, lba, blocks;
|
||||||
|
|
||||||
sector_size= Spotlist_sector_size(spotlist, read_chunk, 0);
|
sector_size= Spotlist_sector_size(spotlist, read_chunk, 0);
|
||||||
sector_blocks= sector_size / 2048;
|
sector_blocks= sector_size / 2048;
|
||||||
@ -1067,12 +1069,10 @@ int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
|
|||||||
m= *map;
|
m= *map;
|
||||||
else {
|
else {
|
||||||
if(*map != NULL) {
|
if(*map != NULL) {
|
||||||
if((*map)->sectors * (*map)->sector_size >
|
if((*map)->sectors * (*map)->sector_size > list_sectors * sector_size)
|
||||||
((off_t) list_sectors) * ((off_t) sector_size))
|
list_sectors= (*map)->sectors * (*map)->sector_size / sector_size + 1;
|
||||||
list_sectors= (*map)->sectors * (*map)->sector_size /
|
|
||||||
((off_t) sector_size) + 1;
|
|
||||||
}
|
}
|
||||||
ret= Sectorbitmap_new(&m, (off_t) list_sectors, (off_t) sector_size, 0);
|
ret= Sectorbitmap_new(&m, list_sectors, sector_size, 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
return(-1);
|
return(-1);
|
||||||
replace_map= 1;
|
replace_map= 1;
|
||||||
@ -1103,8 +1103,6 @@ int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
|
|||||||
continue;
|
continue;
|
||||||
Sectorbitmap_set_range(m, lba / sector_blocks, blocks / sector_blocks,
|
Sectorbitmap_set_range(m, lba / sector_blocks, blocks / sector_blocks,
|
||||||
valid);
|
valid);
|
||||||
Sectorbitmap_set_range(m, (off_t) (lba / sector_blocks),
|
|
||||||
(off_t) ( blocks / sector_blocks), valid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(replace_map) {
|
if(replace_map) {
|
||||||
@ -1138,10 +1136,11 @@ int Xorriso_open_job_data_to(struct XorrisO *xorriso,
|
|||||||
|
|
||||||
|
|
||||||
int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
|
int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
|
||||||
struct SpotlisT *spotlist, int read_chunk,
|
struct SpotlisT *spotlist, off_t read_chunk,
|
||||||
struct CheckmediajoB *job, int flag)
|
struct CheckmediajoB *job, int flag)
|
||||||
{
|
{
|
||||||
int sectors, sector_size, sector_blocks, ret;
|
int ret;
|
||||||
|
off_t sectors, sector_size, sector_blocks;
|
||||||
struct SectorbitmaP *map;
|
struct SectorbitmaP *map;
|
||||||
|
|
||||||
Sectorbitmap_destroy(&(xorriso->in_sector_map), 0);
|
Sectorbitmap_destroy(&(xorriso->in_sector_map), 0);
|
||||||
@ -1155,8 +1154,7 @@ int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
|
|||||||
sector_blocks= sector_size / 2048;
|
sector_blocks= sector_size / 2048;
|
||||||
if(sector_blocks > 1)
|
if(sector_blocks > 1)
|
||||||
sectors= sectors / sector_blocks + !!(sectors % sector_blocks);
|
sectors= sectors / sector_blocks + !!(sectors % sector_blocks);
|
||||||
ret= Sectorbitmap_new(&(xorriso->in_sector_map), (off_t) sectors,
|
ret= Sectorbitmap_new(&(xorriso->in_sector_map), sectors, sector_size, 0);
|
||||||
(off_t) sector_size, 0);
|
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
return(ret);
|
return(ret);
|
||||||
if(map != NULL)
|
if(map != NULL)
|
||||||
|
@ -32,7 +32,7 @@ int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso,
|
|||||||
*/
|
*/
|
||||||
int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
|
int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
|
||||||
struct SpotlisT *spotlist,
|
struct SpotlisT *spotlist,
|
||||||
int read_chunk,
|
off_t read_chunk,
|
||||||
struct SectorbitmaP **map,
|
struct SectorbitmaP **map,
|
||||||
int flag);
|
int flag);
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ int Xorriso_check_media_list_job(struct XorrisO *xorriso,
|
|||||||
char *report, int flag);
|
char *report, int flag);
|
||||||
|
|
||||||
int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
|
int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
|
||||||
struct SpotlisT *spotlist, int read_chunk,
|
struct SpotlisT *spotlist, off_t read_chunk,
|
||||||
struct CheckmediajoB *job, int flag);
|
struct CheckmediajoB *job, int flag);
|
||||||
|
|
||||||
|
|
||||||
@ -66,17 +66,17 @@ int Spotlist_new(struct SpotlisT **o, int flag);
|
|||||||
|
|
||||||
int Spotlist_destroy(struct SpotlisT **o, int flag);
|
int Spotlist_destroy(struct SpotlisT **o, int flag);
|
||||||
|
|
||||||
int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
|
int Spotlist_add_item(struct SpotlisT *o, off_t start_lba, off_t blocks,
|
||||||
int quality, int flag);
|
int quality, int flag);
|
||||||
|
|
||||||
int Spotlist_count(struct SpotlisT *o, int flag);
|
off_t Spotlist_count(struct SpotlisT *o, int flag);
|
||||||
|
|
||||||
int Spotlist_block_count(struct SpotlisT *o, int flag);
|
off_t Spotlist_block_count(struct SpotlisT *o, int flag);
|
||||||
|
|
||||||
int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag);
|
off_t Spotlist_sector_size(struct SpotlisT *o, off_t read_chunk, int flag);
|
||||||
|
|
||||||
int Spotlist_get_item(struct SpotlisT *o, int idx,
|
int Spotlist_get_item(struct SpotlisT *o, off_t idx,
|
||||||
int *start_lba, int *blocks, int *quality, int flag);
|
off_t *start_lba, off_t *blocks, int *quality, int flag);
|
||||||
|
|
||||||
char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
|
char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
|
||||||
int flag);
|
int flag);
|
||||||
|
@ -2578,7 +2578,7 @@ int Xorriso__add_spot(struct xorriso_md5_state *state,
|
|||||||
if(ret != 0)
|
if(ret != 0)
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
ret= Spotlist_add_item(state->spotlist, start_lba, blocks, quality, 0);
|
ret= Spotlist_add_item(state->spotlist, (off_t) start_lba, (off_t) blocks, quality, 0);
|
||||||
if(state->chunk != NULL) {
|
if(state->chunk != NULL) {
|
||||||
uret= pthread_mutex_unlock(&(state->spot_mutex));
|
uret= pthread_mutex_unlock(&(state->spot_mutex));
|
||||||
if(uret != 0 && ret > 0)
|
if(uret != 0 && ret > 0)
|
||||||
@ -3255,10 +3255,11 @@ ex:;
|
|||||||
int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
|
int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
|
||||||
struct CheckmediajoB *job, int flag)
|
struct CheckmediajoB *job, int flag)
|
||||||
{
|
{
|
||||||
int media_blocks= 0, read_chunk= 32, ret, mode, start_lba= 0;
|
int media_blocks= 0, read_chunk= 32, ret, mode;
|
||||||
int blocks, os_errno, i, j, last_track_end= -1, track_blocks, track_lba;
|
|
||||||
int num_sessions, num_tracks, declare_untested= 0, md5_start;
|
int num_sessions, num_tracks, declare_untested= 0, md5_start;
|
||||||
int read_capacity= -1, end_lba, hret, count, quality, profile_no;
|
int os_errno, j, track_blocks;
|
||||||
|
int read_capacity= -1, end_lba, hret, quality, profile_no;
|
||||||
|
off_t i, blocks, last_track_end= -1, count, track_lba, start_lba= 0;
|
||||||
int track_bad_claim= 0;
|
int track_bad_claim= 0;
|
||||||
char *toc_info= NULL, profile_name[80], msg[160];
|
char *toc_info= NULL, profile_name[80], msg[160];
|
||||||
struct burn_drive *drive;
|
struct burn_drive *drive;
|
||||||
@ -3313,7 +3314,7 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
|
|||||||
mode= job->mode;
|
mode= job->mode;
|
||||||
if(job->min_lba > 0) {
|
if(job->min_lba > 0) {
|
||||||
start_lba= job->min_lba;
|
start_lba= job->min_lba;
|
||||||
ret= Spotlist_add_item(*spotlist, 0, job->min_lba,
|
ret= Spotlist_add_item(*spotlist, (off_t) 0, (off_t) job->min_lba,
|
||||||
Xorriso_read_quality_untesteD, 0);
|
Xorriso_read_quality_untesteD, 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
@ -3346,8 +3347,8 @@ no_readable_medium:;
|
|||||||
if(job->max_lba >= 0) {
|
if(job->max_lba >= 0) {
|
||||||
blocks= job->max_lba + 1 - start_lba;
|
blocks= job->max_lba + 1 - start_lba;
|
||||||
xorriso->pacifier_total= blocks;
|
xorriso->pacifier_total= blocks;
|
||||||
ret= Xorriso_check_interval(xorriso, *spotlist, job, start_lba, blocks,
|
ret= Xorriso_check_interval(xorriso, *spotlist, job, (int) start_lba, (int) blocks,
|
||||||
read_chunk, start_lba, 0);
|
read_chunk, (int) start_lba, 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
|
|
||||||
@ -3386,7 +3387,7 @@ no_tracks_found:;
|
|||||||
track_bad_claim= track_lba + track_blocks;
|
track_bad_claim= track_lba + track_blocks;
|
||||||
if(track_lba >= read_capacity) {
|
if(track_lba >= read_capacity) {
|
||||||
sprintf(msg, "-check_media: Track %d of session %d begins after end of readable medium area.",
|
sprintf(msg, "-check_media: Track %d of session %d begins after end of readable medium area.",
|
||||||
j + 1, i + 1);
|
j + 1, (int) (i + 1));
|
||||||
Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0);
|
Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
@ -3398,7 +3399,7 @@ no_tracks_found:;
|
|||||||
Xorriso_msgs_submit(xorriso, 0, msg, 0, "DEBUG", 0);
|
Xorriso_msgs_submit(xorriso, 0, msg, 0, "DEBUG", 0);
|
||||||
} else {
|
} else {
|
||||||
sprintf(msg, "-check_media: Track %d of session %d extends over the end of readable medium area.",
|
sprintf(msg, "-check_media: Track %d of session %d extends over the end of readable medium area.",
|
||||||
j + 1, i + 1);
|
j + 1, (int) (i + 1));
|
||||||
Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0);
|
Xorriso_msgs_submit(xorriso, 0, msg, 0, "WARNING", 0);
|
||||||
}
|
}
|
||||||
track_blocks= read_capacity - track_lba;
|
track_blocks= read_capacity - track_lba;
|
||||||
@ -3434,12 +3435,12 @@ no_tracks_found:;
|
|||||||
if(track_blocks <= 0)
|
if(track_blocks <= 0)
|
||||||
continue;
|
continue;
|
||||||
if(declare_untested) {
|
if(declare_untested) {
|
||||||
ret= Spotlist_add_item(*spotlist, track_lba, track_blocks,
|
ret= Spotlist_add_item(*spotlist, track_lba, (off_t) track_blocks,
|
||||||
Xorriso_read_quality_untesteD, 0);
|
Xorriso_read_quality_untesteD, 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
} else {
|
} else {
|
||||||
ret= Xorriso_check_interval(xorriso, *spotlist, job, track_lba,
|
ret= Xorriso_check_interval(xorriso, *spotlist, job, (int) track_lba,
|
||||||
track_blocks, read_chunk, md5_start,
|
track_blocks, read_chunk, md5_start,
|
||||||
(i > 0) | (4 * (xorriso->do_md5 & 1)));
|
(i > 0) | (4 * (xorriso->do_md5 & 1)));
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
@ -3459,8 +3460,8 @@ no_tracks_found:;
|
|||||||
quality= Xorriso_read_quality_tao_enD;
|
quality= Xorriso_read_quality_tao_enD;
|
||||||
else
|
else
|
||||||
quality= Xorriso_read_quality_unreadablE;
|
quality= Xorriso_read_quality_unreadablE;
|
||||||
ret= Spotlist_add_item(*spotlist, read_capacity,
|
ret= Spotlist_add_item(*spotlist, (off_t) read_capacity,
|
||||||
track_bad_claim - read_capacity, quality, 0);
|
(off_t) (track_bad_claim - read_capacity), quality, 0);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
}
|
||||||
@ -3479,7 +3480,7 @@ no_tracks_found:;
|
|||||||
*/
|
*/
|
||||||
track_lba= isoburn_get_attached_start_lba(drive);
|
track_lba= isoburn_get_attached_start_lba(drive);
|
||||||
if(track_lba >= 0) {
|
if(track_lba >= 0) {
|
||||||
ret= isoburn_read_iso_head(drive, track_lba, &track_blocks, NULL, 0);
|
ret= isoburn_read_iso_head(drive, (int) track_lba, &track_blocks, NULL, 0);
|
||||||
if(ret > 0) {
|
if(ret > 0) {
|
||||||
blocks= media_blocks= track_lba + track_blocks;
|
blocks= media_blocks= track_lba + track_blocks;
|
||||||
}
|
}
|
||||||
@ -3490,14 +3491,14 @@ no_tracks_found:;
|
|||||||
if(media_blocks <= 0)
|
if(media_blocks <= 0)
|
||||||
goto libburn_whole_disc;
|
goto libburn_whole_disc;
|
||||||
xorriso->pacifier_total= blocks;
|
xorriso->pacifier_total= blocks;
|
||||||
ret= Xorriso_check_interval(xorriso, *spotlist, job, start_lba, blocks,
|
ret= Xorriso_check_interval(xorriso, *spotlist, job, (int) start_lba, (int) blocks,
|
||||||
read_chunk, start_lba, (4 * (xorriso->do_md5 & 1)));
|
read_chunk, (int) start_lba, (4 * (xorriso->do_md5 & 1)));
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
} else if(mode == 2) {
|
} else if(mode == 2) {
|
||||||
libburn_whole_disc:;
|
libburn_whole_disc:;
|
||||||
/* single sweep over libburn medium capacity */
|
/* single sweep over libburn medium capacity */
|
||||||
ret= burn_get_read_capacity(drive, &blocks, 0);
|
ret= burn_get_read_capacity_v2(drive, &blocks, 0);
|
||||||
if(ret <= 0) {
|
if(ret <= 0) {
|
||||||
Xorriso_process_msg_queues(xorriso,0);
|
Xorriso_process_msg_queues(xorriso,0);
|
||||||
sprintf(xorriso->info_text, "No content detected on media");
|
sprintf(xorriso->info_text, "No content detected on media");
|
||||||
@ -3506,8 +3507,8 @@ libburn_whole_disc:;
|
|||||||
}
|
}
|
||||||
blocks-= start_lba;
|
blocks-= start_lba;
|
||||||
xorriso->pacifier_total= blocks;
|
xorriso->pacifier_total= blocks;
|
||||||
ret= Xorriso_check_interval(xorriso, *spotlist, job, start_lba, blocks,
|
ret= Xorriso_check_interval(xorriso, *spotlist, job, (int) start_lba, (int) blocks,
|
||||||
read_chunk, start_lba, (4 * (xorriso->do_md5 & 1)));
|
read_chunk, (int) start_lba, (4 * (xorriso->do_md5 & 1)));
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
}
|
||||||
@ -3531,7 +3532,7 @@ ex:;
|
|||||||
end_lba= start_lba + blocks;
|
end_lba= start_lba + blocks;
|
||||||
}
|
}
|
||||||
if(read_capacity > end_lba) {
|
if(read_capacity > end_lba) {
|
||||||
hret= Spotlist_add_item(*spotlist, end_lba, read_capacity - end_lba,
|
hret= Spotlist_add_item(*spotlist, (off_t) end_lba, (off_t) (read_capacity - end_lba),
|
||||||
Xorriso_read_quality_untesteD, 0);
|
Xorriso_read_quality_untesteD, 0);
|
||||||
if(hret < ret)
|
if(hret < ret)
|
||||||
ret= hret;
|
ret= hret;
|
||||||
@ -3539,10 +3540,11 @@ ex:;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ret > 0)
|
if(ret > 0)
|
||||||
ret= Xorriso_update_in_sector_map(xorriso, *spotlist, read_chunk, job, 0);
|
ret= Xorriso_update_in_sector_map(xorriso, *spotlist, (off_t) read_chunk,
|
||||||
|
job, 0);
|
||||||
|
|
||||||
if(ret > 0) {
|
if(ret > 0) {
|
||||||
ret= Xorriso_spotlist_to_sectormap(xorriso, *spotlist, read_chunk,
|
ret= Xorriso_spotlist_to_sectormap(xorriso, *spotlist, (off_t) read_chunk,
|
||||||
&(job->sector_map), 2);
|
&(job->sector_map), 2);
|
||||||
if(ret > 0 && job->sector_map_path[0]) {
|
if(ret > 0 && job->sector_map_path[0]) {
|
||||||
ret= Sectorbitmap_to_file(job->sector_map, job->sector_map_path, toc_info,
|
ret= Sectorbitmap_to_file(job->sector_map, job->sector_map_path, toc_info,
|
||||||
|
@ -1919,7 +1919,8 @@ ex:;
|
|||||||
int Xorriso_option_check_media(struct XorrisO *xorriso,
|
int Xorriso_option_check_media(struct XorrisO *xorriso,
|
||||||
int argc, char **argv, int *idx, int flag)
|
int argc, char **argv, int *idx, int flag)
|
||||||
{
|
{
|
||||||
int ret, i, count, lba, blocks, quality, pass, was_md5= 0, was_event= 0;
|
int ret, quality, pass, was_md5= 0, was_event= 0;
|
||||||
|
off_t i, count, lba, blocks;
|
||||||
int end_idx, old_idx, os_errno, to_info= 0;
|
int end_idx, old_idx, os_errno, to_info= 0;
|
||||||
char quality_name[80], *head_buffer= NULL;
|
char quality_name[80], *head_buffer= NULL;
|
||||||
struct SpotlisT *spotlist= NULL;
|
struct SpotlisT *spotlist= NULL;
|
||||||
@ -2038,9 +2039,10 @@ int Xorriso_option_check_media(struct XorrisO *xorriso,
|
|||||||
else if(pass == 1 && !(quality == Xorriso_read_quality_md5_matcH ||
|
else if(pass == 1 && !(quality == Xorriso_read_quality_md5_matcH ||
|
||||||
quality == Xorriso_read_quality_md5_mismatcH))
|
quality == Xorriso_read_quality_md5_mismatcH))
|
||||||
continue;
|
continue;
|
||||||
sprintf(xorriso->result_line, "%s: %10d , %10d , %s\n",
|
sprintf(xorriso->result_line, "%s: %10.f , %10.f , %s\n",
|
||||||
pass == 0 ? "Media region " : "MD5 tag range",
|
pass == 0 ? "Media region " : "MD5 tag range",
|
||||||
lba, blocks, Spotlist__quality_name(quality, quality_name,
|
(double) lba, (double) blocks,
|
||||||
|
Spotlist__quality_name(quality, quality_name,
|
||||||
xorriso->check_media_bad_limit, 0));
|
xorriso->check_media_bad_limit, 0));
|
||||||
if(to_info) {
|
if(to_info) {
|
||||||
strcpy(xorriso->info_text, xorriso->result_line);
|
strcpy(xorriso->info_text, xorriso->result_line);
|
||||||
|
@ -2418,7 +2418,8 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
|
|||||||
off_t bytes, int flag)
|
off_t bytes, int flag)
|
||||||
{
|
{
|
||||||
int ret, i, lba_count= 0, *start_lbas= NULL, *end_lbas= NULL, read_chunk= 16;
|
int ret, i, lba_count= 0, *start_lbas= NULL, *end_lbas= NULL, read_chunk= 16;
|
||||||
int lba, count, blocks, quality, spot, bad_extract= 0;
|
int quality, bad_extract= 0;
|
||||||
|
off_t lba, count, blocks, spot;
|
||||||
int data_to_skip= 0;
|
int data_to_skip= 0;
|
||||||
uint32_t indev_blocks;
|
uint32_t indev_blocks;
|
||||||
off_t size= 0, file_base_bytes= 0, file_processed_bytes= 0, img_adr;
|
off_t size= 0, file_base_bytes= 0, file_processed_bytes= 0, img_adr;
|
||||||
@ -2481,7 +2482,7 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
|
|||||||
for(i= 0; i < lba_count && file_base_bytes < upto_file_bytes; i++) {
|
for(i= 0; i < lba_count && file_base_bytes < upto_file_bytes; i++) {
|
||||||
lba= start_lbas[i];
|
lba= start_lbas[i];
|
||||||
count= end_lbas[i] + 1 - start_lbas[i];
|
count= end_lbas[i] + 1 - start_lbas[i];
|
||||||
new_file_base_bytes= file_base_bytes + ((off_t) count) * (off_t) 2048;
|
new_file_base_bytes= file_base_bytes + count * (off_t) 2048;
|
||||||
|
|
||||||
/* skip intervals before img_offset */
|
/* skip intervals before img_offset */
|
||||||
if(new_file_base_bytes <= img_offset) {
|
if(new_file_base_bytes <= img_offset) {
|
||||||
@ -2489,7 +2490,7 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Eventually adjust first interval start */
|
/* Eventually adjust first interval start */
|
||||||
img_adr= ((off_t) lba) * (off_t) 2048;
|
img_adr= lba * (off_t) 2048;
|
||||||
if(file_base_bytes < img_offset) {
|
if(file_base_bytes < img_offset) {
|
||||||
img_adr+= img_offset - file_base_bytes;
|
img_adr+= img_offset - file_base_bytes;
|
||||||
lba= img_adr / (off_t) 2048;
|
lba= img_adr / (off_t) 2048;
|
||||||
@ -2505,8 +2506,8 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
|
|||||||
job->data_to_limit= size - file_base_bytes;
|
job->data_to_limit= size - file_base_bytes;
|
||||||
job->data_to_skip= data_to_skip;
|
job->data_to_skip= data_to_skip;
|
||||||
data_to_skip= 0;
|
data_to_skip= 0;
|
||||||
file_processed_bytes+= ((off_t) count) * (off_t) 2048;
|
file_processed_bytes+= count * (off_t) 2048;
|
||||||
ret= Xorriso_check_interval(xorriso, spotlist, job, lba, count, read_chunk,
|
ret= Xorriso_check_interval(xorriso, spotlist, job, (int) lba, (int) count, read_chunk,
|
||||||
0, (flag & 2));
|
0, (flag & 2));
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2024.03.17.160830"
|
#define Xorriso_timestamP "2024.03.17.205516"
|
||||||
|
Loading…
Reference in New Issue
Block a user