[brasero] Fix #615959 - Displays "starting to record" during whole burn process It seems that is some unseen



commit b9cbaa4e46db3426dbe56c3a4055bb8ed6d25f4b
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sat Jun 5 15:19:40 2010 +0200

    Fix #615959  - Displays "starting to record" during whole burn process
    It seems that is some unseen circumstances, cdrecord and wodim returns another string which prevented proper parsing of progress, ...

 plugins/cdrkit/burn-wodim.c      |    7 ++++++-
 plugins/cdrtools/burn-cdrecord.c |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/plugins/cdrkit/burn-wodim.c b/plugins/cdrkit/burn-wodim.c
index b2aa62c..9e14b3a 100644
--- a/plugins/cdrkit/burn-wodim.c
+++ b/plugins/cdrkit/burn-wodim.c
@@ -284,7 +284,10 @@ brasero_wodim_stdout_read (BraseroProcess *process, const gchar *line)
 	priv = BRASERO_WODIM_PRIVATE (wodim);
 
 	if (sscanf (line, "Track %2u: %d of %d MB written (fifo %d%%) [buf %d%%] %d.%dx.",
-		    &track, &mb_written, &mb_total, &fifo, &buf, &speed_1, &speed_2) == 7) {
+		    &track, &mb_written, &mb_total, &fifo, &buf, &speed_1, &speed_2) == 7 ||
+	    /* This is for DVD+R */
+	    sscanf (line, "Track %2u:    %d of %d MB written (fifo  %d%%) [buf  %d%%] |%*s  %*s|   %d.%dx.",
+	            &track, &mb_written, &mb_total, &fifo, &buf, &speed_1, &speed_2) == 7) {
 		gdouble current_rate;
 
 		current_rate = (gdouble) ((gdouble) speed_1 +
@@ -301,6 +304,8 @@ brasero_wodim_stdout_read (BraseroProcess *process, const gchar *line)
 		brasero_job_start_progress (BRASERO_JOB (wodim), FALSE);
 	} 
 	else if (sscanf (line, "Track %2u:    %d MB written (fifo %d%%) [buf  %d%%]  %d.%dx.",
+			 &track, &mb_written, &fifo, &buf, &speed_1, &speed_2) == 6 ||
+	         sscanf (line, "Track %2u:    %d MB written (fifo %d%%) [buf  %d%%] |%*s  %*s|   %d.%dx.",
 			 &track, &mb_written, &fifo, &buf, &speed_1, &speed_2) == 6) {
 		gdouble current_rate;
 
diff --git a/plugins/cdrtools/burn-cdrecord.c b/plugins/cdrtools/burn-cdrecord.c
index fd5f6e8..db75675 100644
--- a/plugins/cdrtools/burn-cdrecord.c
+++ b/plugins/cdrtools/burn-cdrecord.c
@@ -273,7 +273,10 @@ brasero_cdrecord_stdout_read (BraseroProcess *process, const gchar *line)
 	priv = BRASERO_CD_RECORD_PRIVATE (cdrecord);
 
 	if (sscanf (line, "Track %2u: %d of %d MB written (fifo %d%%) [buf %d%%] %d.%dx.",
-		    &track, &mb_written, &mb_total, &fifo, &buf, &speed_1, &speed_2) == 7) {
+		    &track, &mb_written, &mb_total, &fifo, &buf, &speed_1, &speed_2) == 7 ||
+	    /* This is for DVD+R */
+	    sscanf (line, "Track %2u:    %d of %d MB written (fifo  %d%%) [buf  %d%%] |%*s  %*s|   %d.%dx.",
+	            &track, &mb_written, &mb_total, &fifo, &buf, &speed_1, &speed_2) == 7) {
 		gdouble current_rate;
 
 		current_rate = (gdouble) ((gdouble) speed_1 +
@@ -290,6 +293,8 @@ brasero_cdrecord_stdout_read (BraseroProcess *process, const gchar *line)
 		brasero_job_start_progress (BRASERO_JOB (cdrecord), FALSE);
 	} 
 	else if (sscanf (line, "Track %2u:    %d MB written (fifo %d%%) [buf  %d%%]  %d.%dx.",
+			 &track, &mb_written, &fifo, &buf, &speed_1, &speed_2) == 6 ||
+	         sscanf (line, "Track %2u:    %d MB written (fifo %d%%) [buf  %d%%] |%*s  %*s|   %d.%dx.",
 			 &track, &mb_written, &fifo, &buf, &speed_1, &speed_2) == 6) {
 		gdouble current_rate;
 



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