Update of /cvsroot/audacity/audacity-src/src
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26422

Modified Files:
        Mix.cpp 
Log Message:
Don't get too much audio if the selection is shorter than the track.

Index: Mix.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Mix.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- Mix.cpp     22 Nov 2009 03:04:26 -0000      1.81
+++ Mix.cpp     5 Dec 2009 00:13:54 -0000       1.82
@@ -452,13 +452,14 @@
    int c;
    double t = *pos / track->GetRate();
    double trackEndTime = track->GetEndTime();
+   double tEnd = trackEndTime > mT1 ? mT1 : trackEndTime;
 
-   //don't process if we're at the end of the track.
-   if (t>=trackEndTime)
+   //don't process if we're at the end of the selection or track.
+   if (t>=tEnd)
       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 we're about to approach the end of the track or selection, figure out 
how much we need to grab 
+   if (t + slen/track->GetRate() > tEnd)
+      slen = (int)((tEnd - t) * track->GetRate() + 0.5);
 
    if (slen > mMaxOut)
       slen = mMaxOut;


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to