=== modified file 'mixxx/src/engine/enginebuffer.cpp'
--- old/mixxx/src/engine/enginebuffer.cpp	2010-07-25 20:37:35 +0000
+++ new/mixxx/src/engine/enginebuffer.cpp	2010-08-25 03:18:32 +0000
@@ -255,14 +255,14 @@
     // The right place to do this?
     if (m_pScale)
         m_pScale->clear();
-    m_pReadAheadManager->notifySeek(filepos_play);
+    m_pReadAheadManager->notifySeek(getSamplePosition());
 
     // Must hold the engineLock while using m_engineControls
     m_engineLock.lock();
     for (QList<EngineControl*>::iterator it = m_engineControls.begin();
          it != m_engineControls.end(); it++) {
         EngineControl *pControl = *it;
-        pControl->notifySeek(filepos_play);
+        pControl->notifySeek(getSamplePosition());
     }
     m_engineLock.unlock();
 }
@@ -329,7 +329,7 @@
 
     // Seek reader
     Hint seek_hint;
-    seek_hint.sample = new_playpos;
+    seek_hint.sample = getSamplePosition();
     seek_hint.length = 0;
     seek_hint.priority = 1;
     QList<Hint> hint_list;
@@ -455,10 +455,12 @@
 
         // If paused, then ramp out.
         if (bCurBufferPaused) {
+            
             // If this is the first process() since being paused, then ramp out.
             if (!m_bLastBufferPaused) {
                 rampOut(pOut, iBufferSize);
             }
+            
         // Otherwise, scale the audio.
         } else { // if (bCurBufferPaused)
             CSAMPLE *output;
@@ -466,17 +468,13 @@
 
             Q_ASSERT(even(iBufferSize));
 
-            // The fileposition should be: (why is this thing a double anyway!?
-            // Integer valued.
-            Q_ASSERT(round(filepos_play) == filepos_play);
-            // Even.
-            Q_ASSERT(even(filepos_play));
-
+            
             // Perform scaling of Reader buffer into buffer.
             output = m_pScale->scale(0,
                                      iBufferSize,
                                      0,
                                      0);
+            
             idx = m_pScale->getNewPlaypos();
 
             // qDebug() << "sourceSamples used " << iSourceSamples
@@ -488,40 +486,21 @@
             // Copy scaled audio into pOutput
             memcpy(pOutput, output, sizeof(CSAMPLE) * iBufferSize);
 
-            // for(int i=0; i<iBufferSize; i++) {
-            //     pOutput[i] = output[i];
-            // }
-
-            // Adjust filepos_play by the amount we processed.
             filepos_play += idx;
             filepos_play = math_max(0, filepos_play); 
-            // We need the above protection against negative playpositions
-            // in case SoundTouch/EngineBufferSoundTouch gives us too many samples. 
-
-            // Get rid of annoying decimals that the scaler sometimes produces
-            filepos_play = round(filepos_play);
-
-            if (!even(filepos_play))
-                filepos_play--;
-
+            
         } // else (bCurBufferPaused)
 
         m_engineLock.lock();
         QListIterator<EngineControl*> it(m_engineControls);
         while (it.hasNext()) {
             EngineControl* pControl = it.next();
-            pControl->setCurrentSample(filepos_play);
-            double control_seek = pControl->process(rate, filepos_play,
+            pControl->setCurrentSample(getSamplePosition());
+            double control_seek = pControl->process(rate, getSamplePosition(),
                                                     file_length_old, iBufferSize);
 
             if (control_seek != kNoTrigger) {
                 filepos_play = control_seek;
-                Q_ASSERT(round(filepos_play) == filepos_play);
-
-                // Safety check that the EngineControl didn't pass us a bogus
-                // value
-                if (!even(filepos_play))
-                    filepos_play--;
 
                 // Fix filepos_play so that it is not out of bounds.
                 if (file_length_old > 0) {
@@ -542,7 +521,7 @@
                 // the engine and RAMAN can get out of sync.
 
                 //setNewPlaypos(filepos_play);
-                m_pReadAheadManager->notifySeek(filepos_play);
+                m_pReadAheadManager->notifySeek(getSamplePosition());
             }
         }
         m_engineLock.unlock();
@@ -661,15 +640,19 @@
 
     // Increase samplesCalculated by the buffer size
     m_iSamplesCalculated += iBufferSize;
+    double pos = round(filepos_play);
+    if ( ! even(pos))
+        pos--;
 
     double fFractionalPlaypos = 0.0;
     if (file_length_old!=0.) {
-        fFractionalPlaypos = math_max(0.,math_min(filepos_play,file_length_old));
-        fFractionalPlaypos /= file_length_old;
+        fFractionalPlaypos = math_max(0.,math_min(pos,file_length_old));
+        fFractionalPlaypos /= (double)file_length_old;
     } else {
         fFractionalPlaypos = 0.;
     }
 
+    //qDebug() << "Fractional Playpos=" << fFractionalPlaypos;
     // Update indicators that are only updated after every
     // sampleRate/UPDATE_RATE samples processed.  (e.g. playposSlider,
     // rateEngine)
@@ -732,3 +715,16 @@
 void EngineBuffer::bindWorkers(EngineWorkerScheduler* pWorkerScheduler) {
     pWorkerScheduler->bindWorker(m_pReader);
 }
+
+int EngineBuffer::getSamplePosition()
+{
+    int pos;
+    
+    
+    pos = (int)filepos_play;
+    if ( ! even(pos))
+        pos++;
+    
+    return pos;
+}
+

=== modified file 'mixxx/src/engine/enginebuffer.h'
--- old/mixxx/src/engine/enginebuffer.h	2010-07-15 19:07:16 +0000
+++ new/mixxx/src/engine/enginebuffer.h	2010-08-25 03:18:32 +0000
@@ -164,8 +164,11 @@
     // List of hints to provide to the CachingReader
     QList<Hint> m_hintList;
 
-    /** The current sample to play in the file. */
+    /** The current position to play in the file. */
     double filepos_play;
+    /** Calculate the current sample to play in the file */
+    int getSamplePosition();
+    
     /** Copy of rate_exchange, used to check if rate needs to be updated */
     double rate_old;
     /** Copy of length of file */

=== modified file 'mixxx/src/engine/enginebufferscalelinear.cpp'
--- old/mixxx/src/engine/enginebufferscalelinear.cpp	2010-06-17 07:20:57 +0000
+++ new/mixxx/src/engine/enginebufferscalelinear.cpp	2010-08-25 03:18:32 +0000
@@ -134,26 +134,38 @@
     if ( samples != unscaled_samples_needed)
         m_scaleRemainder += (double)unscaled_samples_needed - samples;
 
-    bool carry_remainder = FALSE;    
+    bool carry_remainder = FALSE;
+        
     if ((m_scaleRemainder > 1) || (m_scaleRemainder < 1))
     {
         long rem = (long)floor(m_scaleRemainder);
         
         // Be very defensive about equating the remainder
         // back into unscaled_samples_needed
-	if ((unscaled_samples_needed - rem) >= 1)
-	{
+	    if ((unscaled_samples_needed - rem) >= 1)
+	    {
             carry_remainder = TRUE;
             m_scaleRemainder -= rem;
             unscaled_samples_needed -= rem;
         }
         
     }
+    
 
     // Multiply by 2 because it is predicting mono rates, while we want a stereo
     // number of samples.
     unscaled_samples_needed *= 2;
-    
+    if ( ! even(unscaled_samples_needed))
+        unscaled_samples_needed++;
+    
+    samples *= 2;
+    
+    if (m_dBaseRate >= 0)
+        new_playpos += samples;
+    else if (m_dBaseRate < 0)
+        new_playpos -= samples;
+
+
     Q_ASSERT(unscaled_samples_needed >= 0);
     Q_ASSERT(unscaled_samples_needed != 0);
 
@@ -164,11 +176,11 @@
     long prev_sample = 0;
     bool last_read_failed = false;
 
-    // Use new_playpos to count the new samples we touch.
-    new_playpos = 0;
 
     int i = 0;
     int screwups = 0;
+
+
     while(i < buf_size)
     {
         prev_sample = current_sample;
@@ -199,10 +211,6 @@
             buffer_size = m_pReadAheadManager
                                 ->getNextSamples(m_dBaseRate,buffer_int,
                                                               samples_to_read);
-            if (m_dBaseRate > 0)
-                new_playpos += buffer_size;
-            else if (m_dBaseRate < 0)
-                new_playpos -= buffer_size;
 
 
             if (buffer_size == 0 && last_read_failed) {

=== modified file 'mixxx/src/engine/readaheadmanager.cpp'
--- old/mixxx/src/engine/readaheadmanager.cpp	2010-07-18 03:48:10 +0000
+++ new/mixxx/src/engine/readaheadmanager.cpp	2010-08-25 03:18:32 +0000
@@ -111,10 +111,14 @@
 
 void ReadAheadManager::setNewPlaypos(int iNewPlaypos) {
     m_iCurrentPosition = iNewPlaypos;
+    if ( !even(iNewPlaypos))
+        m_iCurrentPosition++;
 }
 
 void ReadAheadManager::notifySeek(int iSeekPosition) {
     m_iCurrentPosition = iSeekPosition;
+    if ( !even(iSeekPosition))
+        m_iCurrentPosition++;
 }
 
 void ReadAheadManager::hintReader(QList<Hint>& hintList, int iSamplesPerBuffer) {

