| Summary: | incorrect (?) capacity auto detection | ||
|---|---|---|---|
| Product: | [Applications] k3b | Reporter: | Maciej Pilichowski <bluedzins> | 
| Component: | general | Assignee: | Sebastian Trueg <trueg> | 
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Screenshot of the situation | ||
| 
 
        
          Description
        
        
          Maciej Pilichowski
        
        
        
        
          2007-04-18 21:20:08 UTC
        
       
    ha, now I understand my stupid code comment again. ;) well, closing the other one created this one again.... :( Created attachment 20318 [details]
Screenshot of the situation
Did I get the situation right? I wrote some MB to a CD-RW and then let K3b
auto-detect again. The sizes are all correct: capacity (702 used for project),
~17 MB used, and ~685 MB remaining.
Is this the situation that fails for you or did I not understand it correctly?
    Did you burn it with no multissesion? Anyway, such situation does not work for me. In my case I would see the disc capacity 18MB, remaining 400KB. No, auto settings. I will retry without ms. I did miss that. SVN commit 656084 by trueg:
There are days when I just feel damn stupid: hey, idiot, 100b != 0x100. Man, what an obvious bug! But not anymore. Now it is fixed! :)
BUG: 144400
 M  +11 -12    k3bdevice.cpp  
--- trunk/extragear/multimedia/k3b/libk3bdevice/k3bdevice.cpp #656083:656084
@@ -2043,21 +2043,20 @@
       switch( media ) {
       case MEDIA_CD_R:
       case MEDIA_CD_RW:
-	// The code below does not produce valid values. I just leave it here so I won't try it again. ;)
-// 	if( inf.m_capacity == 0 ) {
-// 	  if( readTocPmaAtip( &data, dataLen, 0x100, true, 0 ) ) {
+	if( inf.m_capacity == 0 ) {
+	  if( readTocPmaAtip( &data, dataLen, 0x4, true, 0 ) ) {
 
-// 	    struct atip_descriptor* atip = (struct atip_descriptor*)data;
+	    struct atip_descriptor* atip = (struct atip_descriptor*)data;
 
-// 	    if( dataLen >= 11 ) {
-// 	      inf.m_capacity = K3b::Msf( atip->lead_out_m, atip->lead_out_s, atip->lead_out_f ) - 150;
-// 	      debugBitfield( &atip->lead_out_m, 3 );
-// 	      k3bDebug() << blockDeviceName() << ": ATIP capacity: " << inf.m_capacity.toString() << endl;
-// 	    }
+	    if( dataLen >= 11 ) {
+	      inf.m_capacity = K3b::Msf( atip->lead_out_m, atip->lead_out_s, atip->lead_out_f ) - 150;
+	      debugBitfield( &atip->lead_out_m, 3 );
+	      k3bDebug() << blockDeviceName() << ": ATIP capacity: " << inf.m_capacity.toString() << endl;
+	    }
 
-// 	    delete [] data;
-// 	  }
-// 	}
+	    delete [] data;
+	  }
+	}
 
 	//
 	// for empty and appendable media capacity and usedCapacity should be filled in from
     |