Improved -check_media with overwritable media and unknown content

This commit is contained in:
Thomas Schmitt 2011-07-24 20:39:38 +00:00
parent 8a67604efc
commit 076d8d1eb8
2 changed files with 19 additions and 13 deletions

View File

@ -2349,7 +2349,7 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
} else if(mode == 0) { /* track by track */ } else if(mode == 0) { /* track by track */
isoburn_disc= isoburn_toc_drive_get_disc(drive); isoburn_disc= isoburn_toc_drive_get_disc(drive);
if(isoburn_disc == NULL) if(isoburn_disc == NULL)
goto no_content_visible; goto libburn_whole_disc;
isoburn_sessions= isoburn_sessions=
isoburn_toc_disc_get_sessions(isoburn_disc, &num_sessions); isoburn_toc_disc_get_sessions(isoburn_disc, &num_sessions);
for(i= 0; i < num_sessions; i++) { for(i= 0; i < num_sessions; i++) {
@ -2420,27 +2420,33 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
} else if(mode == 1) { /* isoburn disc capacity */ } else if(mode == 1) { /* isoburn disc capacity */
isoburn_disc= isoburn_toc_drive_get_disc(drive); isoburn_disc= isoburn_toc_drive_get_disc(drive);
if(isoburn_disc == NULL) { if(isoburn_disc == NULL)
no_content_visible:; goto libburn_whole_disc;
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text, "No content detected on media");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
blocks= media_blocks= isoburn_toc_disc_get_sectors(isoburn_disc); blocks= media_blocks= isoburn_toc_disc_get_sectors(isoburn_disc);
if(start_lba >= 0) if(start_lba >= 0)
blocks-= start_lba; blocks-= start_lba;
if(media_blocks <= 0) if(media_blocks <= 0)
goto no_content_visible; 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, start_lba, blocks,
read_chunk, 0, 0); read_chunk, 0, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} else if(mode == 2) { } else if(mode == 2) {
libburn_whole_disc:;
/* >>> single sweep over libburn media capacity */; /* single sweep over libburn media capacity */
ret= burn_get_read_capacity(drive, &blocks, 0);
if(ret <= 0) {
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text, "No content detected on media");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
xorriso->pacifier_total= blocks;
ret= Xorriso_check_interval(xorriso, *spotlist, job, 0, blocks,
read_chunk, 0, 0);
if(ret <= 0)
goto ex;
} }
Xorriso_pacifier_callback(xorriso, "sectors examined", Xorriso_pacifier_callback(xorriso, "sectors examined",

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.07.24.193433" #define Xorriso_timestamP "2011.07.24.203919"