Corrected -check_media handling of last track on BD-R resp. BD-ROM

This commit is contained in:
Thomas Schmitt 2010-10-21 18:04:07 +00:00
parent 28625475a5
commit 9958692b23
2 changed files with 16 additions and 3 deletions

View File

@ -2009,8 +2009,8 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
int media_blocks= 0, read_chunk= 16, ret, mode, start_lba= 0;
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 read_capacity= -1, end_lba, hret, count, quality;
char *toc_info= NULL;
int read_capacity= -1, end_lba, hret, count, quality, profile_no;
char *toc_info= NULL, profile_name[80];
struct burn_drive *drive;
struct burn_drive_info *dinfo;
struct isoburn_toc_disc *isoburn_disc= NULL;
@ -2069,6 +2069,9 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
ret= burn_get_read_capacity(drive, &read_capacity, 0);
if(ret <= 0)
read_capacity= -1;
ret = burn_disc_get_profile(drive, &profile_no, profile_name);
if(ret <= 0)
profile_no= 0;
if(job->max_lba >= 0) {
blocks= job->max_lba + 1 - start_lba;
@ -2093,6 +2096,16 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
continue;
track_lba= isoburn_entry.start_lba;
track_blocks= isoburn_entry.track_blocks;
/* The last track of an appendable BD-R reports more blocks than the
read capacity allows. All BD-R track sizes are multiple of 64 kB.
*/
if (i == num_sessions - 1 &&
(track_lba + track_blocks > read_capacity &&
track_lba + track_blocks < read_capacity + 32 &&
(profile_no == 0x41 || profile_no == 0x40)))
track_blocks= read_capacity - track_lba;
md5_start= track_lba;
if(i == 0 && j == 0) {
if(track_lba == 32) {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.10.20.170546"
#define Xorriso_timestamP "2010.10.21.180343"