[brasero] Set the size of the image when creating a new one with brasero_track_image_new()



commit 8a7c8372d92512dc42381135d9a0f85fd5d74383
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sat Aug 1 19:48:51 2009 +0200

    Set the size of the image when creating a new one with brasero_track_image_new()
    Fix some progress reporting problems

 libbrasero-burn/burn-process.c    |    4 ++++
 plugins/cdrdao/burn-toc2cue.c     |    4 ++++
 plugins/dvdcss/burn-dvdcss.c      |    4 ++++
 plugins/libburnia/burn-libisofs.c |    4 ++++
 4 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libbrasero-burn/burn-process.c b/libbrasero-burn/burn-process.c
index db70d57..62fe0de 100644
--- a/libbrasero-burn/burn-process.c
+++ b/libbrasero-burn/burn-process.c
@@ -256,6 +256,7 @@ brasero_process_finished (BraseroProcess *self)
 	if (brasero_track_type_get_has_image (type)) {
 		gchar *toc = NULL;
 		gchar *image = NULL;
+		goffset blocks = 0;
 
 		track = BRASERO_TRACK (brasero_track_image_new ());
 		brasero_job_get_image_output (BRASERO_JOB (self),
@@ -269,6 +270,9 @@ brasero_process_finished (BraseroProcess *self)
 
 		g_free (image);
 		g_free (toc);
+
+		brasero_job_get_session_output_size (BRASERO_JOB (self), &blocks, NULL);
+		brasero_track_image_set_block_num (BRASERO_TRACK_IMAGE (track), blocks);
 	}
 	else if (brasero_track_type_get_has_stream (type)) {
 		gchar *uri = NULL;
diff --git a/plugins/cdrdao/burn-toc2cue.c b/plugins/cdrdao/burn-toc2cue.c
index 418e5b6..c2f5b8f 100644
--- a/plugins/cdrdao/burn-toc2cue.c
+++ b/plugins/cdrdao/burn-toc2cue.c
@@ -83,6 +83,7 @@ brasero_toc2cue_read_stderr (BraseroProcess *process,
 	gchar *tmp_img_path;
 	GIOChannel *source;
 	guint tmp_path_len;
+	goffset blocks = 0;
 	GIOStatus status;
 	gchar *img_path;
 	gchar *toc_path;
@@ -212,6 +213,9 @@ brasero_toc2cue_read_stderr (BraseroProcess *process,
 	g_free (img_path);
 	g_free (toc_path);
 
+	brasero_job_get_session_output_size (BRASERO_JOB (self), &blocks, NULL);
+	brasero_track_image_set_block_num (track, blocks);
+
 	brasero_job_add_track (BRASERO_JOB (process), BRASERO_TRACK (track));
 
 	/* It's good practice to unref the track afterwards as we don't need it
diff --git a/plugins/dvdcss/burn-dvdcss.c b/plugins/dvdcss/burn-dvdcss.c
index 92c320f..0d1f590 100644
--- a/plugins/dvdcss/burn-dvdcss.c
+++ b/plugins/dvdcss/burn-dvdcss.c
@@ -145,6 +145,7 @@ error_loading:
 static gboolean
 brasero_dvdcss_thread_finished (gpointer data)
 {
+	goffset blocks = 0;
 	gchar *image = NULL;
 	BraseroDvdcss *self = data;
 	BraseroDvdcssPrivate *priv;
@@ -171,6 +172,9 @@ brasero_dvdcss_thread_finished (gpointer data)
 					NULL,
 					BRASERO_IMAGE_FORMAT_BIN);
 
+	brasero_job_get_session_output_size (BRASERO_JOB (self), &blocks, NULL);
+	brasero_track_image_set_block_num (track, blocks);
+
 	brasero_job_add_track (BRASERO_JOB (self), BRASERO_TRACK (track));
 
 	/* It's good practice to unref the track afterwards as we don't need it
diff --git a/plugins/libburnia/burn-libisofs.c b/plugins/libburnia/burn-libisofs.c
index 298ed5a..a5c7c29 100644
--- a/plugins/libburnia/burn-libisofs.c
+++ b/plugins/libburnia/burn-libisofs.c
@@ -99,6 +99,7 @@ brasero_libisofs_thread_finished (gpointer data)
 	if (brasero_job_get_fd_out (BRASERO_JOB (self), NULL) != BRASERO_BURN_OK) {
 		BraseroTrackImage *track = NULL;
 		gchar *output = NULL;
+		goffset blocks = 0;
 
 		/* Let's make a track */
 		track = brasero_track_image_new ();
@@ -110,6 +111,9 @@ brasero_libisofs_thread_finished (gpointer data)
 						NULL,
 						BRASERO_IMAGE_FORMAT_BIN);
 
+		brasero_job_get_session_output_size (BRASERO_JOB (self), &blocks, NULL);
+		brasero_track_image_set_block_num (track, blocks);
+
 		brasero_job_add_track (BRASERO_JOB (self), BRASERO_TRACK (track));
 
 		/* It's good practice to unref the track afterwards as we don't



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]