[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [k3b/multisession] /: Update multisession implementation as Thomas suggested
From:       Leslie Zhai <xiangzhai83 () gmail ! com>
Date:       2016-09-27 2:38:29
Message-ID: E1boiHt-0007RS-8e () code ! kde ! org
[Download RAW message or body]

Git commit b189d1c39b52d5b646a089863eb8f44d3eeaa333 by Leslie Zhai.
Committed on 27/09/2016 at 02:30.
Pushed by lesliezhai into branch 'multisession'.

Update multisession implementation as Thomas suggested

Summary:
- emit error infoMessage for checking nextSessionStart in setupMultiSessionParameters
- nextTrack for bdr_plus_pow
- lastSessionStart for bdr_plus_pow

I am on vacation from Sep, 27 to Oct, 9 in small village, so I can *NOT*
quick response.

CCBUG: 367639

M  +4    -0    libk3b/projects/datacd/k3bdatamultisessionparameterjob.cpp
M  +13   -4    libk3bdevice/k3bdevice.cpp

http://commits.kde.org/k3b/b189d1c39b52d5b646a089863eb8f44d3eeaa333

diff --git a/libk3b/projects/datacd/k3bdatamultisessionparameterjob.cpp \
b/libk3b/projects/datacd/k3bdatamultisessionparameterjob.cpp index 4c3f080..daf229d \
                100644
--- a/libk3b/projects/datacd/k3bdatamultisessionparameterjob.cpp
+++ b/libk3b/projects/datacd/k3bdatamultisessionparameterjob.cpp
@@ -278,6 +278,10 @@ bool \
K3b::DataMultiSessionParameterJob::setupMultiSessionParameters()  }
 
     d->previousSessionStart = lastSessionStart;
+    if (nextSessionStart == 0) {
+        emit infoMessage(i18n("Medium is not of multi-session type and does not \
contain ISO 9660. Cannot emulate multi-session on it."), MessageError); +        \
return false; +    }
     d->nextSessionStart = nextSessionStart;
 
     return true;
diff --git a/libk3bdevice/k3bdevice.cpp b/libk3bdevice/k3bdevice.cpp
index f51c8ea..2cec00a 100644
--- a/libk3bdevice/k3bdevice.cpp
+++ b/libk3bdevice/k3bdevice.cpp
@@ -3580,7 +3580,11 @@ bool K3b::Device::Device::getNextWritableAdress( unsigned int& \
lastSessionStart,  //
             if( !(inf->border & 0x2) ) {
                 // the incomplete track number is the first track in the last \
                session (the empty session)
-                int nextTrack = inf->first_track_l|inf->first_track_m<<8;
+                int nextTrack;
+                if (m == MEDIA_BD_R_SRM_POW)
+                    nextTrack = inf->last_track_l | inf->last_track_m << 8;
+                else
+                    nextTrack  = inf->first_track_l | inf->first_track_m << 8;
 
                 UByteArray trackData;
 
@@ -3591,10 +3595,15 @@ bool K3b::Device::Device::getNextWritableAdress( unsigned \
int& lastSessionStart,  else
                         nextWritableAdress = from4Byte( &trackData[8] );
 
-                    // Read start address of the first track in the last session
-                    if( readTocPmaAtip( trackData, 0x1, false, 0x0  ) ) {
-                        lastSessionStart = from4Byte( &trackData[8] );
+                    if (m == MEDIA_BD_R_SRM_POW) {
+                        lastSessionStart = 0;
                         success = true;
+                    } else {
+                        // Read start address of the first track in the last session
+                        if (readTocPmaAtip(trackData, 0x1, false, 0x0)) {
+                            lastSessionStart = from4Byte(&trackData[8]);
+                            success = true;
+                        }
                     }
                 }
             }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic