isoburn_read_volset() now hands out an official volset reference

This commit is contained in:
Thomas Schmitt 2007-10-18 14:48:35 +00:00
parent be43aab45f
commit 49b1637579
3 changed files with 6 additions and 8 deletions

View File

@ -137,6 +137,7 @@ int isoburn_read_volset(struct burn_drive *d, struct isoburn_read_opts *read_opt
return -3; return -3;
o->target_volset = *volset; o->target_volset = *volset;
iso_volset_ref(o->target_volset); /* protects object from premature free */
read_opts->hasRR = ropts.hasRR; read_opts->hasRR = ropts.hasRR;
read_opts->hasJoliet = ropts.hasJoliet; read_opts->hasJoliet = ropts.hasJoliet;
@ -211,7 +212,7 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
drive= o->drive; drive= o->drive;
/* we can assume 0 as start block for image */ /* we can assume 0 as start block for image */
// TODO what about ms? where we validate valid iso image in ms disc? /* TODO what about ms? where we validate valid iso image in ms disc? */
ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head, ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head,
sizeof(o->target_iso_head), &data_count, 1); sizeof(o->target_iso_head), &data_count, 1);
@ -240,7 +241,7 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
/* sanity check */ /* sanity check */
if (pvm->vol_desc_type[0] != 1 || pvm->vol_desc_version[0] != 1 if (pvm->vol_desc_type[0] != 1 || pvm->vol_desc_version[0] != 1
|| pvm->file_structure_version[0] != 1 ) { || pvm->file_structure_version[0] != 1 ) {
// TODO for now I treat this as a full disc /* TODO for now I treat this as a full disc */
o->fabricated_disc_status= BURN_DISC_FULL; o->fabricated_disc_status= BURN_DISC_FULL;
return 1; return 1;
} }

View File

@ -1 +1 @@
#define Xorriso_timestamP "2007.10.17.225837" #define Xorriso_timestamP "2007.10.18.144841"

View File

@ -189,11 +189,8 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
drive= dinfo[0].drive; drive= dinfo[0].drive;
isoburn_drive_release(drive,0); isoburn_drive_release(drive,0);
/* >>> this should be an official reference for this pointer which was iso_volset_free((struct iso_volset *) xorriso->in_volset_handle);
handed out by isoburn_read_volset() and attached to invisible xorriso->in_volset_handle= NULL;
struct isoburn. Then to be processed by: iso_volset_free(volset);
*/
xorriso->in_volset_handle= NULL; /* destroyed by isoburn_drive_release() */
xorriso->volset_change_pending= 0; xorriso->volset_change_pending= 0;
burn_drive_info_free(dinfo); burn_drive_info_free(dinfo);