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 WriteSource.cpp


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/core ReadSource.cpp WriteSource.cpp
Date: Thu, 27 Sep 2007 20:55:50 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/09/27 20:55:50

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

Log message:
        * Do not assert in ReadSource if no reader was there, but return 0 
frames in get_nframes()
        * minor cleanup in Writesource

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ReadSource.cpp?cvsroot=traverso&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/WriteSource.cpp?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.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- ReadSource.cpp      27 Sep 2007 19:46:52 -0000      1.65
+++ ReadSource.cpp      27 Sep 2007 20:55:50 -0000      1.66
@@ -269,6 +269,10 @@
 {
        Q_ASSERT(rate > 0);
        
+       if (! m_audioReader) {
+               return;
+       }
+       
        m_audioReader->set_output_rate(rate);
        m_outputRate = rate;
        
@@ -315,7 +319,9 @@
 
 const nframes_t ReadSource::get_nframes( ) const
 {
-       Q_ASSERT(m_audioReader);
+       if (!m_audioReader) {
+               return 0;
+       }
        return m_audioReader->get_nframes();
 }
 
@@ -432,7 +438,7 @@
                // 1023.. Hmm, something isn't correct here, but at least 
substract 1
                // to make this thing work!
                // TODO check if this is still needed!
-               fileposition = m_clip->get_source_start_location() - TimeRef(1, 
audiodevice().get_sample_rate());
+               fileposition = m_clip->get_source_start_location() - TimeRef(1, 
m_outputRate);
        }
        
 //     printf("rb_seek_to_file_position:: seeking to relative pos: %d\n", 
fileposition);
@@ -557,7 +563,7 @@
 
        float size = config().get_property("Hardware", "readbuffersize", 
1.0).toDouble();
 
-       m_bufferSize = (int) (size * audiodevice().get_sample_rate());
+       m_bufferSize = (int) (size * m_outputRate);
 
        m_chunkSize = m_bufferSize / DiskIO::bufferdividefactor;
 

Index: WriteSource.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/WriteSource.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- WriteSource.cpp     26 Sep 2007 20:46:33 -0000      1.37
+++ WriteSource.cpp     27 Sep 2007 20:55:50 -0000      1.38
@@ -88,7 +88,7 @@
 
                        m_src_data.output_frames = m_out_samples_max / 
m_channelCount;
                        int rate = audiodevice().get_sample_rate();
-                       m_src_data.end_of_input = ((m_spec->pos.to_frame(rate) 
+ nframes) >= m_spec->endLocation.to_frame(rate));
+                       m_src_data.end_of_input = (m_spec->pos + 
TimeRef(nframes, rate)) >= m_spec->endLocation;
                        m_src_data.data_out = m_dataF2;
 
                        if (m_leftover_frames > 0) {




reply via email to

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