Bug 144400 - incorrect (?) capacity auto detection
Summary: incorrect (?) capacity auto detection
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-18 21:20 UTC by Maciej Pilichowski
Modified: 2007-04-20 10:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of the situation (142.68 KB, image/png)
2007-04-18 23:07 UTC, Sebastian Trueg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pilichowski 2007-04-18 21:20:08 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    SuSE RPMs

Maybe it is just a duplicate of: https://bugs.kde.org/show_bug.cgi?id=140494 . I am opening this report instead of reopening, because the effects look different.

1.1svn, 64.1.

Blank cdrw inserted (700MB) --> 700MB detected.
2.8MB burned (NO MULTISESSION), disc reinserted -> 3.0MB capacity detected.

I think that k3b should show real capacity, not what's left in session, because I didn't use importing previous session.
Comment 1 Sebastian Trueg 2007-04-18 23:05:32 UTC
ha, now I understand my stupid code comment again. ;)
well, closing the other one created this one again.... :(
Comment 2 Sebastian Trueg 2007-04-18 23:07:46 UTC
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?
Comment 3 Maciej Pilichowski 2007-04-19 22:18:02 UTC
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. 
Comment 4 Sebastian Trueg 2007-04-20 08:23:37 UTC
No, auto settings. I will retry without ms. I did miss that.
Comment 5 Sebastian Trueg 2007-04-20 10:53:03 UTC
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