Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23889

Modified Files:
        Mix.cpp 
Log Message:
Changing MixSameRate to behave like MixVariableRate - it should not fetch 
samples past the end of its track.


Index: Mix.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Mix.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- Mix.cpp     22 Sep 2009 00:21:24 -0000      1.80
+++ Mix.cpp     22 Nov 2009 03:04:26 -0000      1.81
@@ -451,12 +451,14 @@
    int slen = mMaxOut;
    int c;
    double t = *pos / track->GetRate();
+   double trackEndTime = track->GetEndTime();
 
-   if (t + slen/track->GetRate() > mT1)
-      slen = (int)((mT1 - t) * track->GetRate() + 0.5);
-   
-   if (slen <= 0)
+   //don't process if we're at the end of the track.
+   if (t>=trackEndTime)
       return 0;
+   //if we're about to approach the end of the track, figure out how much we 
need to grab 
+   if (t + slen/track->GetRate() > trackEndTime)
+      slen = (int)((trackEndTime - t) * track->GetRate() + 0.5);
 
    if (slen > mMaxOut)
       slen = mMaxOut;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to