Ignore:
Timestamp:
08/27/10 04:10:58 (21 months ago)
Author:
shiretu
Message:

-- android stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/applications/applestreamingclient/src/clientcontext.cpp

    r106 r109  
    5656        _lastWallClock = 0; 
    5757        _avData.EnsureSize(_maxAVBufferSize * 3); 
     58        _firstFeedTime = 0; 
    5859        INFO("Context created: %d (%p)", _id, this); 
    5960} 
     
    323324        //1. initialize _lastFeedTime 
    324325        if (_lastWallClock == 0) { 
     326#ifdef HAS_MS_TIMER 
     327                GETCLOCKS(_lastWallClock); 
     328#else 
    325329                _lastWallClock = time(NULL)*1000.0; 
     330#endif /* HAS_MS_TIMER */ 
    326331                return true; 
    327332        } 
     
    385390 
    386391        //5. How much seconds do we have to feed? 
     392#ifdef HAS_MS_TIMER 
     393        double currentTime; 
     394        GETCLOCKS(currentTime); 
     395        double wallClockDelta = ((currentTime - _lastWallClock) / (double) CLOCKS_PER_SECOND)*1000.00; 
     396#else 
    387397        double wallClockDelta = time(NULL)*1000.00 - _lastWallClock; 
     398#endif /* HAS_MS_TIMER */ 
     399 
     400        if (_firstFeedTime == 0) { 
     401                _firstFeedTime = pStream->GetFeedTime(); 
     402        } 
    388403 
    389404        //6. Feed 
    390405        //      FINEST("BEFORE: wallClockDelta: %.2f; GetFeedTime: %.2f", 
    391406        //                      wallClockDelta, pStream->GetFeedTime()); 
    392         while ((wallClockDelta > (pStream->GetFeedTime())) && 
     407        while ((wallClockDelta + 1000 > (pStream->GetFeedTime() - _firstFeedTime)) && 
    393408                        (GETAVAILABLEBYTESCOUNT(_avData) > 8192)) { 
    394409                if (!pTS->SignalInputData(_avData)) { 
Note: See TracChangeset for help on using the changeset viewer.