Experiment for TOC on overwriteables: Keep a target_head copy of session #1

This commit is contained in:
2008-05-06 14:45:49 +00:00
parent f830c30196
commit 3eae8634cd
5 changed files with 204 additions and 23 deletions

View File

@ -42,6 +42,51 @@
#include "../version.h"
*/
/* ----------------------- isoburn_toc_entry ---------------------- */
int isoburn_toc_entry_new(struct isoburn_toc_entry **objpt,
struct isoburn_toc_entry *boss, int flag)
{
struct isoburn_toc_entry *o, *s;
*objpt= o= (struct isoburn_toc_entry *)
malloc(sizeof(struct isoburn_toc_entry));
if(o==NULL) {
burn_msgs_submit(0x00060000,
"Cannot allocate memory for isoburn toc entry",
0, "FATAL", NULL);
return(-1);
}
o->session= 0;
o->track_no= 0;
o->start_lba= -1;
o->track_blocks= 0;
o->next= NULL;
if(boss!=NULL) {
for(s= boss; s->next!=NULL; s= s->next);
s->next= o;
}
return(1);
}
/* @param flag bit0= delete all subordinates too
*/
int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag)
{
if(*o==NULL)
return(0);
if(flag&1)
isoburn_toc_entry_destroy(&((*o)->next), flag);
free((char *) (*o));
*o= NULL;
return(1);
}
/* --------------------- end isoburn_toc_entry -------------------- */
/* -------------------------- isoburn ----------------------- */
@ -67,8 +112,9 @@ int isoburn_new(struct isoburn **objpt, int flag)
o->drive= NULL;
o->emulation_mode= 0;
o->min_start_byte= 0;
o->nwa= 0;
o->zero_nwa= Libisoburn_overwriteable_starT;
o->min_start_byte= o->zero_nwa * 2048;
o->nwa= o->zero_nwa;
o->truncate= 0;
#ifdef Libisoburn_no_fifO
@ -77,8 +123,9 @@ int isoburn_new(struct isoburn **objpt, int flag)
o->fifo= NULL;
#endif
o->wrote_well= -1;
o->fabricated_disc_status= BURN_DISC_UNREADY;
o->toc= NULL;
o->wrote_well= -1;
for(i=0;i<65536;i++)
o->target_iso_head[i]= 0;
o->image= NULL;
@ -121,6 +168,8 @@ int isoburn_destroy(struct isoburn **objpt, int flag)
if(o->image!=NULL)
iso_image_unref(o->image);
if(o->toc!=NULL)
isoburn_toc_entry_destroy(&(o->toc), 1); /* all */
#ifdef Libisoburn_no_fifO
if(o->iso_source!=NULL)
burn_source_free(o->iso_source);
@ -339,8 +388,9 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
}
if (nwa == 0 && state == BURN_DISC_APPENDABLE) {
/* invalid nwa */
burn_msgs_submit(0x00060000, "Encountered 0 as next writeable address", 0,
"FAILURE", NULL);
burn_msgs_submit(0x00060000,
"Encountered 0 as next writeable address of appendable",
0, "FAILURE", NULL);
{ret= -4; goto ex;}
}
iso_write_opts_set_ms_block(wopts, nwa);