Addition of a fifo to isolate the libburn writer thread from libisofs

burn_source.
This commit is contained in:
Vreixo Formoso Lopes 2007-10-01 14:26:36 +00:00
parent cd63872e2b
commit fbb4cda0ab

View File

@ -228,7 +228,7 @@ static
int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
struct isoburn_source_opts *opts, int new_img)
{
struct burn_source *wsrc;
struct burn_source *wsrc, fifo_src;
struct burn_session *session;
struct burn_track *track;
struct isoburn *o;
@ -283,14 +283,21 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
wopts.src = o->src;
wopts.overwrite = (new_img ? NULL : o->target_iso_head);
wsrc = iso_source_new_ecma119(o->target_volset, &wopts);
if (wsrc == NULL)
return -1;
// TODO check return values for failure. propertly clean-up on error
fifo_src = burn_fifo_source_new(wsrc, 2048, 2000, 0);
if (fifo_src == NULL) {
fprintf(stderr, "Cannot attach fifo\n");
return -1;
}
*disc = burn_disc_create();
session = burn_session_create();
burn_disc_add_session(*disc, session, BURN_POS_END);
track = burn_track_create();
burn_track_set_source(track, wsrc);
burn_track_set_source(track, fifo_src);
burn_session_add_track(session, track, BURN_POS_END);
return 1;