traverso-commit
[Top][All Lists]
Advanced

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

[Traverso-commit] traverso/src/core SnapList.cpp


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/core SnapList.cpp
Date: Thu, 29 Nov 2007 11:26:28 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/11/29 11:26:28

Modified files:
        src/core       : SnapList.cpp 

Log message:
        * Oops, TimeRef can go back in time (i.e. < 0), so we have to check in 
get_prev/next_snap_pos() for TimeRef values < 0

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/SnapList.cpp?cvsroot=traverso&r1=1.24&r2=1.25

Patches:
Index: SnapList.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/SnapList.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- SnapList.cpp        23 Nov 2007 14:21:08 -0000      1.24
+++ SnapList.cpp        29 Nov 2007 11:26:28 -0000      1.25
@@ -271,12 +271,17 @@
        
        int index = (int)(pos / m_scalefactor);
        
-       TimeRef newpos = pos;
+       if (pos < TimeRef()) {
+               PERROR("pos < 0");
+               return TimeRef();
+       }
        
        if (index > m_xposLut.size()) {
                index = m_xposLut.size() - 1;
        }
        
+       TimeRef newpos = pos;
+       
        for (; index<m_xposLut.size(); ++index) {
                TimeRef snap = m_xposLut.at(index);
                if (snap > pos) {
@@ -294,20 +299,26 @@
                update_snaplist();
        }
        
+       if (pos < TimeRef()) {
+               PERROR("pos < 0");
+               return TimeRef();
+       }
+       
        if (! m_xposLut.size()) {
                return pos;
        }
        
-       TimeRef newpos = pos;
-       
        int index = (int)(pos / m_scalefactor);
+       
        if (index > m_xposLut.size()) {
                index = m_xposLut.size() - 1;
        }
        
+       TimeRef newpos = pos;
+       
        do {
                TimeRef snap = m_xposLut.at(index);
-               if (snap < pos && snap != TimeRef(qint64(0))) {
+               if (snap < pos && snap != TimeRef()) {
                        newpos = snap;
                        break;
                }




reply via email to

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