Changeset 1463

Show
Ignore:
Timestamp:
11/22/08 13:33:40 (15 years ago)
Author:
ppalmers
Message:

fix wraparound bug in bug detect&fix code (go figure)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp

    r1346 r1463  
    413413            int64_t last_timestamp_fixed; 
    414414            // first try to add one second 
    415             last_timestamp_fixed = m_last_timestamp + TICKS_PER_SECOND
     415            last_timestamp_fixed = addTicks(m_last_timestamp, TICKS_PER_SECOND)
    416416            diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 
    417417            if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) { 
     
    421421                debugWarning("HACK: fixed by adding one second of ticks. This is a bug being run-time fixed.\n"); 
    422422                m_last_timestamp = last_timestamp_fixed; 
    423             } 
    424             // then try to subtract one second 
    425             last_timestamp_fixed = m_last_timestamp - TICKS_PER_SECOND; 
    426             if(last_timestamp_fixed >= 0) { 
     423            } else { 
     424                // if that didn't work, try to subtract one second 
     425                last_timestamp_fixed = substractTicks(m_last_timestamp, TICKS_PER_SECOND); 
    427426                diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 
    428427                if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) {