New API call isoburn_cancel_prepared_write()
This commit is contained in:
parent
b006ab11b2
commit
b2b6a9bcd8
@ -414,6 +414,25 @@ int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
|
||||
}
|
||||
|
||||
|
||||
int isoburn_cancel_prepared_write(struct burn_drive *d, int flag)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret<0 || o==NULL)
|
||||
return(-1);
|
||||
if(o->iso_source==NULL)
|
||||
return(0);
|
||||
if(o->iso_source->read!=NULL)
|
||||
return(0);
|
||||
if(o->iso_source->version<1)
|
||||
return(0);
|
||||
o->iso_source->cancel(o->iso_source);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
void isoburn_version(int *major, int *minor, int *micro)
|
||||
{
|
||||
*major= isoburn_header_version_major;
|
||||
|
@ -686,6 +686,19 @@ int isoburn_prepare_new_image(struct burn_drive *in_drive,
|
||||
struct isoburn_imgen_opts *opts,
|
||||
struct burn_drive *out_drive);
|
||||
|
||||
/** Revoke isoburn_prepare_new_image() or isoburn_prepare_disc() instead of
|
||||
running isoburn_disc_write().
|
||||
libisofs reserves resources and maybe already starts generating the
|
||||
image stream when one of above two calls is performed. It is mandatory to
|
||||
either run isoburn_disc_write() or to revoke the preparations by the
|
||||
call described here.
|
||||
@param d The input drive which was used with the preparation call.
|
||||
@param flag Bitfield, submit 0 for now.
|
||||
@return <=0 error , 1 = success
|
||||
*/
|
||||
int isoburn_cancel_prepared_write(struct burn_drive *d, int flag);
|
||||
|
||||
|
||||
/** Start writing of the new session.
|
||||
This call is asynchrounous. I.e. it returns quite soon and the progress has
|
||||
to be watched by a loop with call burn_drive_get_status() until
|
||||
|
@ -1 +1 @@
|
||||
#define Xorriso_timestamP "2008.02.03.155704"
|
||||
#define Xorriso_timestamP "2008.02.03.164038"
|
||||
|
@ -730,7 +730,8 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
|
||||
|
||||
if(xorriso->out_drive_handle == xorriso->in_drive_handle ||
|
||||
xorriso->in_drive_handle == NULL) {
|
||||
ret= isoburn_prepare_disc(drive, &disc, sopts);
|
||||
source_drive= drive;
|
||||
ret= isoburn_prepare_disc(source_drive, &disc, sopts);
|
||||
} else {
|
||||
s= isoburn_disc_get_status(drive);
|
||||
if(s!=BURN_DISC_BLANK) {
|
||||
@ -773,6 +774,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
|
||||
: img_sectors ),
|
||||
media_space);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||
isoburn_cancel_prepared_write(source_drive, 0);
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||
|
||||
@ -783,6 +785,7 @@ no_track:;
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
sprintf(xorriso->info_text,"Program error : no track in prepared disc");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
|
||||
isoburn_cancel_prepared_write(source_drive, 0);
|
||||
{ret= -1; goto ex;}
|
||||
}
|
||||
tracks= burn_session_get_tracks(sessions[0], &num_tracks);
|
||||
|
Loading…
Reference in New Issue
Block a user