traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/core ReadSource.cpp ReadSource.h


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/core ReadSource.cpp ReadSource.h
Date: Thu, 27 Sep 2007 19:46:52 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/09/27 19:46:52

Modified files:
        src/core       : ReadSource.cpp ReadSource.h 

Log message:
        hah, isn't it beautiful ?

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ReadSource.cpp?cvsroot=traverso&r1=1.64&r2=1.65
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ReadSource.h?cvsroot=traverso&r1=1.37&r2=1.38

Patches:
Index: ReadSource.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/ReadSource.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- ReadSource.cpp      27 Sep 2007 19:38:34 -0000      1.64
+++ ReadSource.cpp      27 Sep 2007 19:46:52 -0000      1.65
@@ -270,6 +270,7 @@
        Q_ASSERT(rate > 0);
        
        m_audioReader->set_output_rate(rate);
+       m_outputRate = rate;
        
        // The length could have become slightly smaller/larger due
        // rounding issues involved with converting to one samplerate to 
another.
@@ -357,20 +358,18 @@
                return 0;
        }
 
-       int devicerate = audiodevice().get_sample_rate();
-       
        if (start != m_rbRelativeFileReadPos) {
                
-               TimeRef availabletime(m_buffers.at(0)->read_space(), 
devicerate);
+               TimeRef availabletime(m_buffers.at(0)->read_space(), 
m_outputRate);
                
-               if ( (start > m_rbRelativeFileReadPos) && 
(m_rbRelativeFileReadPos + availabletime) > (start + TimeRef(count, 
devicerate))) {
+               if ( (start > m_rbRelativeFileReadPos) && 
(m_rbRelativeFileReadPos + availabletime) > (start + TimeRef(count, 
m_outputRate))) {
                        
                        TimeRef advance = start - m_rbRelativeFileReadPos;
                        if (availabletime < advance) {
                                printf("available < advance !!!!!!!\n");
                        }
                        for (int i=m_buffers.size()-1; i>=0; --i) {
-                               
m_buffers.at(i)->increment_read_ptr(advance.to_frame(devicerate));
+                               
m_buffers.at(i)->increment_read_ptr(advance.to_frame(m_outputRate));
                        }
                        
                        m_rbRelativeFileReadPos += advance;
@@ -393,7 +392,7 @@
                
        }
 
-       m_rbRelativeFileReadPos.add_frames(readcount, devicerate);
+       m_rbRelativeFileReadPos.add_frames(readcount, m_outputRate);
        
        return readcount;
 }
@@ -402,7 +401,7 @@
 int ReadSource::rb_file_read(DecodeBuffer* buffer, nframes_t cnt)
 {
        int readFrames = file_read(buffer, m_rbFileReadPos, cnt);
-       m_rbFileReadPos.add_frames(readFrames, audiodevice().get_sample_rate());
+       m_rbFileReadPos.add_frames(readFrames, m_outputRate);
 
        return readFrames;
 }
@@ -477,7 +476,7 @@
                // If we are nearing the end of the source file it could be 
possible
                // we only need to read the last samples which is smaller in 
size then 
                // chunksize. If so, set toRead to m_source->m_length - 
rbFileReasPos
-               nframes_t available = (m_length - 
m_rbFileReadPos).to_frame(audiodevice().get_sample_rate());
+               nframes_t available = (m_length - 
m_rbFileReadPos).to_frame(m_outputRate);
                if (available <= m_chunkSize) {
                        toRead = available;
                } else {

Index: ReadSource.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/ReadSource.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- ReadSource.h        27 Sep 2007 19:20:29 -0000      1.37
+++ ReadSource.h        27 Sep 2007 19:46:52 -0000      1.38
@@ -96,6 +96,7 @@
        
        mutable TimeRef         m_length;
        QString         m_decodertype;
+       int                     m_outputRate;
        
        BufferStatus*   m_bufferstatus;
        




reply via email to

[Prev in Thread] Current Thread [Next in Thread]