File grip-errorhandling.patch of Package grip

For now, reduce this patch to to the two error logging functions,
"doing it right"[tm] requires bigger changes which I have in principle
ready but might need some final testing of the built packages,
so this is the part which is 100% safe:

--- grip-3.2.0/src/rip.c	2006/03/23 15:45:02	1.1
+++ grip-3.2.0/src/rip.c	2006/03/23 16:12:08
@@ -1468,6 +1496,14 @@
     bytesleft=BytesLeftInFS(ginfo->ripfile);
 
     if(bytesleft<(ginfo->ripsize*1.5)) {
+      /*
+       * We have to abort ripping because there is not enough space
+       * to rip the next track (plus an extra space just for safety)
+       * Let's show in the status window what we have and what we want:
+       */
+      LogStatus(ginfo,_("Out of space while ripping: "
+			 "%.1f MB left, wanted %.1f MB\n"),
+			(float)bytesleft/1000000, ginfo->ripsize*0.0000015);
       DisplayMsg(_("Out of space in output directory"));
 
       return FALSE;
@@ -1716,6 +1752,13 @@
 	  (gfloat)(ginfo->kbits_per_sec*1024)/600.0);
   
   if(bytesleft<(ginfo->mp3size[cpu]*1.5)) {
+    /*
+     * We have to abort encoding because there is not enough space
+     * to encode the next track (plus an extra space just for safety)
+     * Lets show in the status window what we have and what we want:
+     */
+    LogStatus(ginfo,_("Out of space while encoding: %.1f MB left, wanted %.1f MB\n"),
+       (float)bytesleft/1000000, ginfo->mp3size[cpu]*0.0000015);
     DisplayMsg(_("Out of space in output directory"));
     
     return FALSE;
openSUSE Build Service is sponsored by