[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/core ReadSource.cpp
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/core ReadSource.cpp |
Date: |
Wed, 29 Aug 2007 17:01:30 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/08/29 17:01:30
Modified files:
src/core : ReadSource.cpp
Log message:
ResampleAudioReader masks the real audiofiles samplrate, and gives the
samplerate in use by the AudioDevice.
Due this, conversion from TimeRef to nframes always needs the
audiodevice samplerate, and not the audiofile samplerate.... (somewhat
confusing?)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ReadSource.cpp?cvsroot=traverso&r1=1.52&r2=1.53
Patches:
Index: ReadSource.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/ReadSource.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- ReadSource.cpp 28 Aug 2007 19:51:52 -0000 1.52
+++ ReadSource.cpp 29 Aug 2007 17:01:30 -0000 1.53
@@ -278,7 +278,7 @@
#if defined (profile)
trav_time_t starttime = get_microseconds();
#endif
- nframes_t result = m_audioReader->read_from(buffer, start, cnt);
+ nframes_t result = m_audioReader->read_from(buffer,
start.to_frame(audiodevice().get_sample_rate()), cnt);
#if defined (profile)
int processtime = (int) (get_microseconds() - starttime);
@@ -398,7 +398,7 @@
int ReadSource::rb_file_read(DecodeBuffer* buffer, nframes_t cnt)
{
int readFrames = file_read(buffer, m_rbFileReadPos, cnt);
- m_rbFileReadPos.add_frames(readFrames, m_rate);
+ m_rbFileReadPos.add_frames(readFrames, audiodevice().get_sample_rate());
return readFrames;
}
@@ -429,7 +429,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 = TimeRef(m_clip->get_source_start_frame() - 1,
m_rate);
+ fileposition = TimeRef(m_clip->get_source_start_frame() - 1,
audiodevice().get_sample_rate());
}
// printf("rb_seek_to_file_position:: seeking to relative pos: %d\n",
fileposition);
@@ -472,7 +472,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(m_rate);
+ nframes_t available = (m_length -
m_rbFileReadPos).to_frame(audiodevice().get_sample_rate());
if (available <= m_chunkSize) {
toRead = available;
} else {