"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xorriso/drive_mgt.c" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

drive_mgt.c  (xorriso-1.5.2):drive_mgt.c  (xorriso-1.5.4)
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net> Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
This file contains functions which operate on drives and media. This file contains functions which operate on drives and media.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
#endif #endif
skipping to change at line 199 skipping to change at line 199
goto ex; goto ex;
} }
ret= 1; ret= 1;
ex:; ex:;
xorriso->volset_change_pending= change_pending_rec; xorriso->volset_change_pending= change_pending_rec;
Findjob_destroy(&job, 0); Findjob_destroy(&job, 0);
return(ret); return(ret);
} }
/* @param flag bit0= aquire as isoburn input drive /* @param flag: bit0= set read speed
bit1= aquire as libburn output drive (as isoburn drive if bit0) bit1= set write speed
bit2= regard overwriteable media as blank */
int Xorriso_set_speed(struct XorrisO *xorriso, struct burn_drive *drive,
int read_speed, int write_speed, int flag)
{
int r_speed = 0, w_speed = 0, ret = 0, profile_no= 0;
char profile_name[80];
if((flag & 3) == 0)
return(0);
if(xorriso->read_speed == -2) {
if(!(flag & 2))
return(0);
}
if(flag & 1)
r_speed= read_speed;
if(flag & 2)
w_speed= write_speed;
ret= burn_disc_get_profile(drive, &profile_no, profile_name);
if(ret <= 0)
profile_no= 0;
if((r_speed > 0 || w_speed > 0) && profile_no >= 0x10) {
ret= burn_drive_set_speed_exact(drive, r_speed, w_speed);
if(ret > 0)
goto ex;
}
burn_drive_set_speed(drive, r_speed, w_speed);
ret= 2;
ex:;
Xorriso_process_msg_queues(xorriso,0);
return(ret);
}
/* @param flag bit0= acquire as isoburn input drive
bit1= acquire as libburn output drive (as isoburn drive if bit0)
bit2= regard overwritable media as blank
bit3= if the drive is a regular disk file: truncate it to bit3= if the drive is a regular disk file: truncate it to
the write start address the write start address
bit5= do not print toc bit5= do not print toc
bit6= do not calm down drive after aquiring it bit6= do not calm down drive after acquiring it
bit7= re-assess rather than aquire: bit7= re-assess rather than acquire:
Do not give up drives, Do not give up drives,
use isoburn_drive_aquire() with re-assessment bit use isoburn_drive_aquire() with re-assessment bit
@return <=0 failure , 1= ok @return <=0 failure , 1= ok
2=success, but not writeable with bit1 2=success, but not writeable with bit1
3=success, but not blank and not ISO with bit0 3=success, but not blank and not ISO with bit0
*/ */
int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
int flag) int flag)
{ {
int ret, hret, not_writeable= 0, has_what, aquire_flag, load_lba, ext; int ret, hret, not_writeable= 0, has_what, aquire_flag, load_lba, ext;
skipping to change at line 536 skipping to change at line 571
if(xorriso->do_md5 & 32) if(xorriso->do_md5 & 32)
ext|= isoburn_ropt_nomd5tag; ext|= isoburn_ropt_nomd5tag;
if(xorriso->ecma119_map == 0) if(xorriso->ecma119_map == 0)
ext|= isoburn_ropt_map_unmapped; ext|= isoburn_ropt_map_unmapped;
else if(xorriso->ecma119_map == 2) else if(xorriso->ecma119_map == 2)
ext|= isoburn_ropt_map_uppercase; ext|= isoburn_ropt_map_uppercase;
else if(xorriso->ecma119_map == 3) else if(xorriso->ecma119_map == 3)
ext|= isoburn_ropt_map_lowercase; ext|= isoburn_ropt_map_lowercase;
else else
ext|= isoburn_ropt_map_stripped; ext|= isoburn_ropt_map_stripped;
if(xorriso->joliet_map == 0)
ext|= isoburn_ropt_joliet_unmapped;
else
ext|= isoburn_ropt_joliet_stripped;
isoburn_ropt_set_extensions(ropts, ext); isoburn_ropt_set_extensions(ropts, ext);
isoburn_ropt_set_default_perms(ropts, (uid_t) 0, (gid_t) 0, (mode_t) 0555); isoburn_ropt_set_default_perms(ropts, (uid_t) 0, (gid_t) 0, (mode_t) 0555);
isoburn_ropt_set_input_charset(ropts, xorriso->in_charset); isoburn_ropt_set_input_charset(ropts, xorriso->in_charset);
isoburn_ropt_set_auto_incharset(ropts, !!(xorriso->do_aaip & 512)); isoburn_ropt_set_auto_incharset(ropts, !!(xorriso->do_aaip & 512));
isoburn_ropt_set_displacement(ropts, xorriso->displacement, isoburn_ropt_set_displacement(ropts, xorriso->displacement,
xorriso->displacement_sign); xorriso->displacement_sign);
isoburn_ropt_set_truncate_mode(ropts, 1, xorriso->file_name_limit); isoburn_ropt_set_truncate_mode(ropts, 1, xorriso->file_name_limit);
skipping to change at line 568 skipping to change at line 607
ret= isoburn_disc_get_msc1(drive, &load_lba); ret= isoburn_disc_get_msc1(drive, &load_lba);
if(ret > 0) { if(ret > 0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"Loading ISO image tree from LBA %d", load_lba); "Loading ISO image tree from LBA %d", load_lba);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
} }
ret= Xorriso_assert_volid(xorriso, load_lba, 0); ret= Xorriso_assert_volid(xorriso, load_lba, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} }
if(xorriso->read_speed != -2) Xorriso_set_speed(xorriso, drive, xorriso->read_speed, 0, 1);
burn_drive_set_speed(drive, xorriso->read_speed, 0);
read_ret= ret= isoburn_read_image(drive, ropts, &volset); read_ret= ret= isoburn_read_image(drive, ropts, &volset);
/* <<< Resetting to normal thresholds */ /* <<< Resetting to normal thresholds */
if(xorriso->img_read_error_mode>0) if(xorriso->img_read_error_mode>0)
Xorriso_set_abort_severity(xorriso, 0); Xorriso_set_abort_severity(xorriso, 0);
if(ret<=0) { if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
Xorriso_set_image_severities(xorriso, 0); Xorriso_set_image_severities(xorriso, 0);
Xorriso_give_up_drive(xorriso, 1|((flag&32)>>2)); Xorriso_give_up_drive(xorriso, 1|((flag&32)>>2));
skipping to change at line 647 skipping to change at line 685
"on attempt to attach ISO image volset to outdev", 2); "on attempt to attach ISO image volset to outdev", 2);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
iso_image_ref((IsoImage *) xorriso->in_volset_handle); iso_image_ref((IsoImage *) xorriso->in_volset_handle);
isoburn_attach_image(out_drive, xorriso->in_volset_handle); isoburn_attach_image(out_drive, xorriso->in_volset_handle);
if(start_lba >= 0) if(start_lba >= 0)
isoburn_attach_start_lba(out_drive, ret, 0); isoburn_attach_start_lba(out_drive, ret, 0);
} }
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
isoburn_ropt_get_size_what(ropts, &size, &has_what); isoburn_ropt_get_size_what(ropts, &size, &has_what);
xorriso->isofs_size= size;
xorriso->isofs_has_what= has_what;
isoburn_ropt_get_tree_loaded(ropts, &(xorriso->tree_loaded),
&(xorriso->rr_loaded));
if(has_what & isoburn_ropt_has_el_torito) { if(has_what & isoburn_ropt_has_el_torito) {
if(xorriso->boot_image_bin_path[0]) if(xorriso->boot_image_bin_path[0])
boot_fate= "replaced by new boot image"; boot_fate= "replaced by new boot image";
else if(xorriso->patch_isolinux_image & 1) else if(xorriso->patch_isolinux_image & 1)
boot_fate= "patched at boot info table"; boot_fate= "patched at boot info table";
else if(xorriso->keep_boot_image) else if(xorriso->keep_boot_image)
boot_fate= "kept unchanged"; boot_fate= "kept unchanged";
else else
boot_fate= "discarded"; boot_fate= "discarded";
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
skipping to change at line 1227 skipping to change at line 1270
if(is_bdr_pow) { if(is_bdr_pow) {
sprintf(respt, sprintf(respt,
"Media summary: unsuitable Pseudo Overwrite formatted BD-R\n"); "Media summary: unsuitable Pseudo Overwrite formatted BD-R\n");
Xorriso_toc_line(xorriso, flag & 8); Xorriso_toc_line(xorriso, flag & 8);
{ret= 1; goto ex;} {ret= 1; goto ex;}
} }
if(!(flag & 2)) if(!(flag & 2))
Xorriso_show_boot_info(xorriso, 1 | (flag & 8) | ((flag & 1) << 1)); Xorriso_show_boot_info(xorriso, 1 | (flag & 8) | ((flag & 1) << 1));
if(xorriso->isofs_size > 0 && !(flag & 3)) {
sprintf(respt, "ISO offers :%s%s%s%s\n",
xorriso->isofs_has_what & 1 ? " Rock_Ridge" : "",
xorriso->isofs_has_what & 2 ? " Joliet" : "",
xorriso->isofs_has_what & 4 ? " ISO_9660_1999" : "",
xorriso->isofs_has_what & 7 ? "" : " Only_ECMA_119");
Xorriso_toc_line(xorriso, flag & 8);
sprintf(respt, "ISO loaded : %s\n",
xorriso->tree_loaded == 1 ? "Joliet" :
xorriso->tree_loaded == 2 ? "ISO_9660_1999" :
xorriso->rr_loaded > 0 ? "Rock_Ridge" : "Only_ECMA_119");
Xorriso_toc_line(xorriso, flag & 8);
}
disc= isoburn_toc_drive_get_disc(drive); disc= isoburn_toc_drive_get_disc(drive);
if(flag & 4) if(flag & 4)
sprintf(respt, "TOC layout : %3s , %9s , %10s\n", sprintf(respt, "TOC layout : %3s , %9s , %10s\n",
"Idx", "sbsector", "Size"); "Idx", "sbsector", "Size");
else else
sprintf(respt, "TOC layout : %3s , %9s , %10s , %s\n", sprintf(respt, "TOC layout : %3s , %9s , %10s , %s\n",
"Idx", "sbsector", "Size", "Volume Id"); "Idx", "sbsector", "Size", "Volume Id");
if(!(flag&1)) if(!(flag&1))
Xorriso_toc_line(xorriso, flag & 8); Xorriso_toc_line(xorriso, flag & 8);
skipping to change at line 2281 skipping to change at line 2338
if(flag == 0) if(flag == 0)
burn_set_scsi_logging(0); burn_set_scsi_logging(0);
else else
burn_set_scsi_logging(2|4); burn_set_scsi_logging(2|4);
return(1); return(1);
} }
int Xorriso_check_md5_range(struct XorrisO *xorriso, off_t start_lba, int Xorriso_check_md5_range(struct XorrisO *xorriso, off_t start_lba,
off_t end_lba, char md5[16], int flag) off_t end_lba, char md5[16], int flag)
{ {
int ret; int ret, us_corr = 0;
struct burn_drive_info *dinfo= NULL; struct burn_drive_info *dinfo= NULL;
struct burn_drive *drive= NULL; struct burn_drive *drive= NULL;
off_t pos, data_count, to_read; off_t pos, data_count, to_read, slowdown_count= 0;
char *data= NULL, data_md5[16]; char *data= NULL, data_md5[16];
void *ctx = NULL; void *ctx = NULL;
struct timeval prev_time;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to check session MD5 checksum", 0); "on attempt to check session MD5 checksum", 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
Xorriso_alloc_meM(data, char, 64 * 1024); Xorriso_alloc_meM(data, char, 64 * 1024);
ret= iso_md5_start(&ctx); ret= iso_md5_start(&ctx);
if(ret <= 0) { if(ret <= 0) {
Xorriso_no_malloc_memory(xorriso, NULL, 0); Xorriso_no_malloc_memory(xorriso, NULL, 0);
goto ex; goto ex;
} }
if(xorriso->read_speed != -2) if(xorriso->read_speed_force > 0) /* initialize forced speed limit */
burn_drive_set_speed(drive, xorriso->read_speed, 0); burn_nominal_slowdown(xorriso->read_speed_force, xorriso->read_speed_corr,
&prev_time, &us_corr, (off_t) 0, 1);
Xorriso_set_speed(xorriso, drive, xorriso->read_speed, 0, 1);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
for(pos= start_lba; pos < end_lba; pos+= 32) { for(pos= start_lba; pos < end_lba; pos+= 32) {
to_read= 32; to_read= 32;
if(pos + to_read > end_lba) if(pos + to_read > end_lba)
to_read= end_lba - pos; to_read= end_lba - pos;
ret= burn_read_data(drive, pos * (off_t) 2048, data, ret= burn_read_data(drive, pos * (off_t) 2048, data,
to_read * (off_t) 2048, &data_count, 0); to_read * (off_t) 2048, &data_count, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
iso_md5_compute(ctx, data, (int) data_count); iso_md5_compute(ctx, data, (int) data_count);
if(xorriso->read_speed_force > 0 && pos + to_read <= end_lba) {
slowdown_count+= data_count;
if(slowdown_count >= 128 * 1024) {
burn_nominal_slowdown(xorriso->read_speed_force,
xorriso->read_speed_corr,
&prev_time, &us_corr, slowdown_count, 0);
slowdown_count= 0;
}
}
xorriso->pacifier_count+= data_count; xorriso->pacifier_count+= data_count;
xorriso->pacifier_byte_count+= data_count; xorriso->pacifier_byte_count+= data_count;
Xorriso_pacifier_callback(xorriso, "content bytes read", Xorriso_pacifier_callback(xorriso, "content bytes read",
xorriso->pacifier_count, 0, "", 8); xorriso->pacifier_count, 0, "", 8);
} }
iso_md5_end(&ctx, data_md5); iso_md5_end(&ctx, data_md5);
ret= 1; ret= 1;
if(! iso_md5_match(md5, data_md5)) if(! iso_md5_match(md5, data_md5))
ret= 0; ret= 0;
ex:; ex:;
skipping to change at line 2703 skipping to change at line 2772
bit2= compute stream MD5 and look out for checksum tag bit2= compute stream MD5 and look out for checksum tag
@return <=0 error, 1= done, 2= aborted due to limit @return <=0 error, 1= done, 2= aborted due to limit
*/ */
int Xorriso_check_interval(struct XorrisO *xorriso, struct SpotlisT *spotlist, int Xorriso_check_interval(struct XorrisO *xorriso, struct SpotlisT *spotlist,
struct CheckmediajoB *job, struct CheckmediajoB *job,
int from_lba, int block_count, int read_chunk, int from_lba, int block_count, int read_chunk,
int md5_start, int flag) int md5_start, int flag)
{ {
int i, j, ret, total_count= 0, sectors= -1, sector_size= -1, skip_reading; int i, j, ret, total_count= 0, sectors= -1, sector_size= -1, skip_reading;
int prev_quality= -1, quality= -1, retry= 0, profile_no, is_cd= 0; int prev_quality= -1, quality= -1, retry= 0, profile_no, is_cd= 0;
int eccb_size= 16; int eccb_size= 16, us_corr = 0, data_skip;
int start_sec, end_sec, first_value, fret, suspect_tao_end= 0; int start_sec, end_sec, first_value, fret, suspect_tao_end= 0;
char profile_name[80]; char profile_name[80];
int start_lba= 0; int start_lba= 0;
struct burn_drive *drive; struct burn_drive *drive;
struct burn_drive_info *dinfo; struct burn_drive_info *dinfo;
char *data= NULL, *data_pt; char *data= NULL, *data_pt;
off_t data_count, to_read, read_count= 0, write_amount, skipped_to_read; off_t data_count, to_read, read_count= 0, write_amount, skipped_to_read;
off_t slowdown_count= 0, seek_adr;
struct timeval prev_time;
double pre_read_time, post_read_time, time_diff, total_time_diff= 0; double pre_read_time, post_read_time, time_diff, total_time_diff= 0;
double last_abort_file_time= 0; double last_abort_file_time= 0;
void *ctx= NULL; void *ctx= NULL;
char md5[16]; char md5[16];
size_t data_size; size_t data_size;
struct xorriso_md5_state state; struct xorriso_md5_state state;
int num_chunks, async_md5; int num_chunks, async_md5;
static off_t chunks_limit= 256 * 1024 * 1024; static off_t chunks_limit= 256 * 1024 * 1024;
memset(&state, 0, sizeof(state)); memset(&state, 0, sizeof(state));
skipping to change at line 2732 skipping to change at line 2803
state.chunk_state= NULL; state.chunk_state= NULL;
state.chunk_fill= NULL; state.chunk_fill= NULL;
state.chunk_lba= NULL; state.chunk_lba= NULL;
state.spotlist= spotlist; state.spotlist= spotlist;
if(read_chunk > 1024) if(read_chunk > 1024)
read_chunk= 1024; read_chunk= 1024;
else if(read_chunk < 1) else if(read_chunk < 1)
read_chunk= 1; read_chunk= 1;
data_skip= job->data_to_skip;
num_chunks= job->async_chunks; num_chunks= job->async_chunks;
if(((off_t) num_chunks) * ((off_t) read_chunk) > chunks_limit) if(((off_t) num_chunks) * ((off_t) read_chunk) > chunks_limit)
num_chunks= chunks_limit / read_chunk; num_chunks= chunks_limit / read_chunk;
async_md5= (num_chunks >= 2); async_md5= (num_chunks >= 2);
if(async_md5) if(async_md5)
data_size= num_chunks * read_chunk * 2048; data_size= num_chunks * read_chunk * 2048;
else else
data_size= read_chunk * 2048; data_size= read_chunk * 2048;
Xorriso_alloc_meM(data, char, data_size); Xorriso_alloc_meM(data, char, data_size);
skipping to change at line 2823 skipping to change at line 2895
state.chunk_r_idx= 0; state.chunk_r_idx= 0;
state.w_sleeps= 0; state.w_sleeps= 0;
state.r_sleeps= 0; state.r_sleeps= 0;
if(async_md5) { if(async_md5) {
ret= Xorriso_start_chunk_md5(xorriso, &state, 0); ret= Xorriso_start_chunk_md5(xorriso, &state, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} }
if(xorriso->read_speed != -2) if(xorriso->read_speed_force > 0) /* initialize forced speed limit */
burn_drive_set_speed(drive, xorriso->read_speed, 0); burn_nominal_slowdown(xorriso->read_speed_force, xorriso->read_speed_corr,
&prev_time, &us_corr, (off_t) 0, 1);
Xorriso_set_speed(xorriso, drive, xorriso->read_speed, 0, 1);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
start_lba= from_lba; start_lba= from_lba;
to_read= read_chunk; to_read= read_chunk;
post_read_time= Sfile_microtime(0); post_read_time= Sfile_microtime(0);
for(i= 0; i < block_count; i+= to_read) { for(i= 0; i < block_count; i+= to_read) {
if(i != 0)
data_skip= 0;
skip_reading= 0; skip_reading= 0;
ret= Xorriso_check_for_abort(xorriso, job->abort_file_path, post_read_time, ret= Xorriso_check_for_abort(xorriso, job->abort_file_path, post_read_time,
&last_abort_file_time, 0); &last_abort_file_time, 0);
if(ret == 1) if(ret == 1)
goto abort_check; goto abort_check;
if(job->item_limit > 0 && if(job->item_limit > 0 &&
Spotlist_count(spotlist, 0) + 2 >= job->item_limit) { Spotlist_count(spotlist, 0) + 2 >= job->item_limit) {
sprintf(xorriso->info_text, "-check_media: Reached item_limit=%d", sprintf(xorriso->info_text, "-check_media: Reached item_limit=%d",
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);
skipping to change at line 2976 skipping to change at line 3052
state.chunk_w_idx= (state.chunk_w_idx + 1) % state.num_chunks; state.chunk_w_idx= (state.chunk_w_idx + 1) % state.num_chunks;
} else { } else {
ret= Xorriso_chunk_md5(xorriso, data_pt, to_read, ret= Xorriso_chunk_md5(xorriso, data_pt, to_read,
(uint32_t) (i + from_lba), &state, 0); (uint32_t) (i + from_lba), &state, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} }
} }
write_amount= data_count; write_amount= data_count - data_skip;
if(data_count > 0) { if(data_count > 0) {
read_count+= data_count; read_count+= data_count - data_skip;
if(job->data_to_limit >= 0 && read_count > job->data_to_limit) if(job->data_to_limit >= 0 && read_count > job->data_to_limit)
write_amount-= (read_count - job->data_to_limit); write_amount-= (read_count - job->data_to_limit);
} }
if(xorriso->read_speed_force > 0) {
slowdown_count+= data_count;
if(slowdown_count >= 128 * 1024) {
burn_nominal_slowdown(xorriso->read_speed_force,
xorriso->read_speed_corr,
&prev_time, &us_corr, slowdown_count, 0);
slowdown_count= 0;
}
}
if(write_amount > 0) { if(write_amount > 0) {
if(job->data_to_fd >= 0) { if(job->data_to_fd >= 0) {
ret= lseek(job->data_to_fd, seek_adr= ((off_t) (i + from_lba)) * (off_t) 2048 +
((off_t) (i + from_lba)) * (off_t) 2048 + job->data_to_offset, job->data_to_skip + job->data_to_offset;
SEEK_SET); if(strcmp(job->data_to_path, "-") != 0) {
if(ret == -1) { ret= lseek(job->data_to_fd, seek_adr, SEEK_SET);
if(ret == -1) {
failed_to_write:; failed_to_write:;
sprintf(xorriso->info_text, "Cannot write %d bytes to lba %d of ", sprintf(xorriso->info_text,
(int) data_count, i + from_lba); "Cannot write %d bytes to position %.f in ",
Text_shellsafe(job->data_to_path, xorriso->info_text, 1); (int) data_count, (double) seek_adr);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, Text_shellsafe(job->data_to_path, xorriso->info_text, 1);
"FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno,
{ret= 0; goto ex;} "FAILURE", 0);
{ret= 0; goto ex;}
}
} }
ret= write(job->data_to_fd, data_pt, write_amount); ret= write(job->data_to_fd, data_pt + data_skip, write_amount);
if(ret == -1) if(ret == -1)
goto failed_to_write; goto failed_to_write;
} }
} }
} }
if(quality != prev_quality) { if(quality != prev_quality) {
if(prev_quality >= 0) { if(prev_quality >= 0) {
ret= Xorriso__add_spot(&state, start_lba, ret= Xorriso__add_spot(&state, start_lba,
i + from_lba - start_lba, prev_quality, 0); i + from_lba - start_lba, prev_quality, 0);
if(ret <= 0) if(ret <= 0)
skipping to change at line 3220 skipping to change at line 3308
} }
track_blocks= read_capacity - track_lba; track_blocks= read_capacity - track_lba;
} }
} }
md5_start= track_lba; md5_start= track_lba;
if(i == 0 && j == 0) { if(i == 0 && j == 0) {
if(track_lba == 32) { if(track_lba == 32) {
ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0); ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0);
if(ret > 0) { if(ret > 0) {
if(caps->start_adr) { if(caps->start_adr) {
/* block 0 to 31 are the overall mount entry of overwriteable */ /* block 0 to 31 are the overall mount entry of overwritable */
track_lba= 0; track_lba= 0;
track_blocks+= 32; track_blocks+= 32;
} }
} }
} }
} }
if(last_track_end >= 0 && last_track_end < track_lba && if(last_track_end >= 0 && last_track_end < track_lba &&
last_track_end >= start_lba) { last_track_end >= start_lba) {
ret= Spotlist_add_item(*spotlist, last_track_end, ret= Spotlist_add_item(*spotlist, last_track_end,
track_lba - last_track_end, track_lba - last_track_end,
skipping to change at line 3326 skipping to change at line 3414
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} }
Xorriso_pacifier_callback(xorriso, "blocks read", Xorriso_pacifier_callback(xorriso, "blocks read",
xorriso->pacifier_count, xorriso->pacifier_total, "", xorriso->pacifier_count, xorriso->pacifier_total, "",
1 | 8 | 16 | 32 | (128 * (job->use_dev == 1))); 1 | 8 | 16 | 32 | (128 * (job->use_dev == 1)));
ret= 1; ret= 1;
ex:; ex:;
if(job->data_to_fd != -1) if(job->data_to_fd != -1 && strcmp(job->data_to_path, "-") != 0)
close(job->data_to_fd); close(job->data_to_fd);
job->data_to_fd= -1; job->data_to_fd= -1;
if(read_capacity >= 0) { if(read_capacity >= 0) {
count= Spotlist_count(*spotlist, 0); count= Spotlist_count(*spotlist, 0);
end_lba= 0; end_lba= 0;
for(i= 0; i < count; i++) { for(i= 0; i < count; i++) {
Spotlist_get_item(*spotlist, i, &start_lba, &blocks, &quality, 0); Spotlist_get_item(*spotlist, i, &start_lba, &blocks, &quality, 0);
if(start_lba + blocks > end_lba) if(start_lba + blocks > end_lba)
end_lba= start_lba + blocks; end_lba= start_lba + blocks;
skipping to change at line 3468 skipping to change at line 3556
} else if(xorriso->use_immed_bit == 0) { } else if(xorriso->use_immed_bit == 0) {
/* obtain default value as determined after drive aquiration */ /* obtain default value as determined after drive aquiration */
if(xorriso->use_immed_bit_default == 0) if(xorriso->use_immed_bit_default == 0)
return(1); return(1);
enable= (xorriso->use_immed_bit_default > 0); enable= (xorriso->use_immed_bit_default > 0);
} }
burn_drive_set_immed(drive, enable); burn_drive_set_immed(drive, enable);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
return(1); return(1);
} }
int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, uint32_t *blocks,
int flag)
{
int ret, num_data;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
enum burn_disc_status s;
*blocks= 0;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to determine readable size", 0);
if(ret <= 0)
return(0);
s= isoburn_disc_get_status(drive);
if(s == BURN_DISC_BLANK)
return(1);
ret= burn_get_read_capacity(drive, &num_data, 0);
if(ret <= 0)
return(0);
*blocks= num_data;
return(1);
}
 End of changes. 26 change blocks. 
30 lines changed or deleted 118 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)