From fbb4cda0ab9cd9b1b7b5e5273ef152e02c0b610c Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Lopes Date: Mon, 1 Oct 2007 14:26:36 +0000 Subject: [PATCH] Addition of a fifo to isolate the libburn writer thread from libisofs burn_source. --- libisoburn/trunk/src/isoburn.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libisoburn/trunk/src/isoburn.c b/libisoburn/trunk/src/isoburn.c index 3fc043d3..b35bbfc7 100644 --- a/libisoburn/trunk/src/isoburn.c +++ b/libisoburn/trunk/src/isoburn.c @@ -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;