|
|
|
@ -800,7 +800,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|
|
|
|
int track_count= 0, session_no, track_no, profile_no= -1, track_size;
|
|
|
|
|
int last_track_start= 0, last_track_size= -1, num_data= 0, is_data= 0;
|
|
|
|
|
int is_inout_drive= 0, drive_role, status, num_formats, emul_lba;
|
|
|
|
|
int not_reconizable= 0;
|
|
|
|
|
int not_recognizable= 0;
|
|
|
|
|
char profile_name[80],*respt,*devadr, *typetext= "";
|
|
|
|
|
struct burn_toc_entry toc_entry;
|
|
|
|
|
struct burn_drive_info *dinfo;
|
|
|
|
@ -869,7 +869,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|
|
|
|
strcat(respt, "\n");
|
|
|
|
|
} else {
|
|
|
|
|
sprintf(respt+strlen(respt), "is not recognizable\n");
|
|
|
|
|
not_reconizable= 1;
|
|
|
|
|
not_recognizable= 1;
|
|
|
|
|
}
|
|
|
|
|
Xorriso_toc_line(xorriso, flag & 8);
|
|
|
|
|
|
|
|
|
@ -881,7 +881,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|
|
|
|
|
|
|
|
|
sprintf(respt, "Media status : ");
|
|
|
|
|
if (s == BURN_DISC_FULL) {
|
|
|
|
|
if(not_reconizable)
|
|
|
|
|
if(not_recognizable)
|
|
|
|
|
sprintf(respt+strlen(respt), "is not recognizable\n");
|
|
|
|
|
else
|
|
|
|
|
sprintf(respt+strlen(respt), "is written , is closed");
|
|
|
|
@ -949,7 +949,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|
|
|
|
if(ret<=0) {
|
|
|
|
|
Xorriso_process_msg_queues(xorriso,0);
|
|
|
|
|
if(flag&1)
|
|
|
|
|
{ret= 0; goto ex;}
|
|
|
|
|
{ret= 1; goto ex;}
|
|
|
|
|
sprintf(xorriso->info_text, "Cannot obtain Table Of Content");
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
|
|
|
|
{ret= 0; goto ex;}
|
|
|
|
@ -1291,11 +1291,55 @@ ex:;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Xorriso_choose_speed_factor(struct XorrisO *xorriso,
|
|
|
|
|
int speed, int profile,
|
|
|
|
|
double *speed_factor, char **speed_unit,
|
|
|
|
|
int flag)
|
|
|
|
|
{
|
|
|
|
|
double cd_factor = 75.0 * 2352;
|
|
|
|
|
double cd_speed_tolerance= 1.5, cd_speed_add;
|
|
|
|
|
int int_cd_speed, i;
|
|
|
|
|
static int cd_speed_list[]= {8, 10, 12, 16, 24, 32, 40, 48, 52, 0};
|
|
|
|
|
|
|
|
|
|
*speed_unit= "D";
|
|
|
|
|
*speed_factor= 1385000.0;
|
|
|
|
|
|
|
|
|
|
/* Does this look like an integer CD speed ? */
|
|
|
|
|
int_cd_speed= ((double) speed) * 1000.0 / cd_factor;
|
|
|
|
|
cd_speed_add= cd_speed_tolerance * (double) int_cd_speed;
|
|
|
|
|
int_cd_speed= (((double) speed) + cd_speed_add)
|
|
|
|
|
* 1000.0 / cd_factor;
|
|
|
|
|
if(abs((int) ((double) int_cd_speed) * cd_factor / 1000.0 -
|
|
|
|
|
((double) speed)) > 2 * cd_speed_add ||
|
|
|
|
|
int_cd_speed > 64)
|
|
|
|
|
int_cd_speed= 0;
|
|
|
|
|
if(int_cd_speed > 7) {
|
|
|
|
|
for(i= 0; cd_speed_list[i]; i++)
|
|
|
|
|
if(int_cd_speed == cd_speed_list[i])
|
|
|
|
|
break;
|
|
|
|
|
if(cd_speed_list[i] == 0)
|
|
|
|
|
int_cd_speed= 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(((profile < 0x08 || profile >= 0x100 || profile == 0x10 || profile == 0x40)
|
|
|
|
|
&& int_cd_speed) ||
|
|
|
|
|
(profile >= 0x08 && profile <= 0x0a)) {
|
|
|
|
|
*speed_unit= "C";
|
|
|
|
|
*speed_factor= cd_factor;
|
|
|
|
|
} else if(profile >= 0x40 && profile <= 0x43) {
|
|
|
|
|
*speed_unit= "B";
|
|
|
|
|
*speed_factor= 4495625.0;
|
|
|
|
|
}
|
|
|
|
|
return(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* @return <=0 error, 1 success
|
|
|
|
|
*/
|
|
|
|
|
int Xorriso_list_speeds(struct XorrisO *xorriso, int flag)
|
|
|
|
|
{
|
|
|
|
|
int ret, high= -1, low= 0x7fffffff, int_cd_speed, is_cd= 0, i;
|
|
|
|
|
int ret, high= -1, low= 0x7fffffff, is_cd= 0, i;
|
|
|
|
|
int recent_profile= 0;
|
|
|
|
|
char *respt, *speed_unit= "D";
|
|
|
|
|
double speed_factor= 1385000.0, cd_factor= 75.0 * 2352;
|
|
|
|
|
struct burn_drive_info *dinfo;
|
|
|
|
@ -1317,12 +1361,18 @@ int Xorriso_list_speeds(struct XorrisO *xorriso, int flag)
|
|
|
|
|
ret= 0; goto ex;
|
|
|
|
|
}
|
|
|
|
|
ret= Xorriso_toc(xorriso, 3);
|
|
|
|
|
if(ret<=0)
|
|
|
|
|
goto ex;
|
|
|
|
|
if(ret<=0) {
|
|
|
|
|
sprintf(xorriso->info_text,
|
|
|
|
|
"Cannot obtain overview of drive and media content");
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
|
|
|
|
ret= 0; goto ex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (item= speed_list; item != NULL; item= item->next) {
|
|
|
|
|
if(item->profile_loaded >= 0x08 && item->profile_loaded <= 0x0a)
|
|
|
|
|
is_cd= 1;
|
|
|
|
|
is_cd= item->profile_loaded;
|
|
|
|
|
if(item->profile_loaded > 0)
|
|
|
|
|
recent_profile= item->profile_loaded;
|
|
|
|
|
if(item->source == 1) {
|
|
|
|
|
/* CD mode page 2Ah : report only if not same speed by GET PERFORMANCE */
|
|
|
|
|
for(other= speed_list; other != NULL; other= other->next)
|
|
|
|
@ -1331,25 +1381,9 @@ int Xorriso_list_speeds(struct XorrisO *xorriso, int flag)
|
|
|
|
|
if(other != NULL)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
speed_unit= "D";
|
|
|
|
|
speed_factor= 1385000.0;
|
|
|
|
|
|
|
|
|
|
/* Does this look like an integer CD speed ? */
|
|
|
|
|
int_cd_speed= ((double) item->write_speed) * 1000.0 / cd_factor;
|
|
|
|
|
if(abs((int) ((double) int_cd_speed) * cd_factor / 1000.0 -
|
|
|
|
|
((double) item->write_speed)) > 5 ||
|
|
|
|
|
int_cd_speed > 64)
|
|
|
|
|
int_cd_speed= 0;
|
|
|
|
|
|
|
|
|
|
if(((item->profile_loaded < 0x08 || item->profile_loaded >= 0x100) &&
|
|
|
|
|
int_cd_speed) ||
|
|
|
|
|
(item->profile_loaded >= 0x08 && item->profile_loaded <= 0x0a)) {
|
|
|
|
|
speed_unit= "C";
|
|
|
|
|
speed_factor= 75.0 * 2352.0;
|
|
|
|
|
} else if(item->profile_loaded >= 0x40 && item->profile_loaded <= 0x43) {
|
|
|
|
|
speed_unit= "B";
|
|
|
|
|
speed_factor= 4495625.0;
|
|
|
|
|
}
|
|
|
|
|
Xorriso_choose_speed_factor(xorriso, item->write_speed,
|
|
|
|
|
item->profile_loaded,
|
|
|
|
|
&speed_factor, &speed_unit, 0);
|
|
|
|
|
sprintf(respt, "Write speed : ");
|
|
|
|
|
sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n",
|
|
|
|
|
item->write_speed,
|
|
|
|
@ -1393,10 +1427,14 @@ int Xorriso_list_speeds(struct XorrisO *xorriso, int flag)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(high > -1) {
|
|
|
|
|
Xorriso_choose_speed_factor(xorriso, low, recent_profile,
|
|
|
|
|
&speed_factor, &speed_unit, 0);
|
|
|
|
|
sprintf(respt, "Write speed L: ");
|
|
|
|
|
sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n",
|
|
|
|
|
low, ((double) low) * 1000.0 / speed_factor, speed_unit);
|
|
|
|
|
Xorriso_result(xorriso,0);
|
|
|
|
|
Xorriso_choose_speed_factor(xorriso, low, recent_profile,
|
|
|
|
|
&speed_factor, &speed_unit, 0);
|
|
|
|
|
sprintf(respt, "Write speed H: ");
|
|
|
|
|
sprintf(respt + strlen(respt), " %5dk , %4.1fx%s\n",
|
|
|
|
|
high, ((double) high) * 1000.0 / speed_factor, speed_unit);
|
|
|
|
|