- Timestamp:
- 08/27/10 04:10:58 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/applications/applestreamingclient/src/clientcontext.cpp
r106 r109 56 56 _lastWallClock = 0; 57 57 _avData.EnsureSize(_maxAVBufferSize * 3); 58 _firstFeedTime = 0; 58 59 INFO("Context created: %d (%p)", _id, this); 59 60 } … … 323 324 //1. initialize _lastFeedTime 324 325 if (_lastWallClock == 0) { 326 #ifdef HAS_MS_TIMER 327 GETCLOCKS(_lastWallClock); 328 #else 325 329 _lastWallClock = time(NULL)*1000.0; 330 #endif /* HAS_MS_TIMER */ 326 331 return true; 327 332 } … … 385 390 386 391 //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 387 397 double wallClockDelta = time(NULL)*1000.00 - _lastWallClock; 398 #endif /* HAS_MS_TIMER */ 399 400 if (_firstFeedTime == 0) { 401 _firstFeedTime = pStream->GetFeedTime(); 402 } 388 403 389 404 //6. Feed 390 405 // FINEST("BEFORE: wallClockDelta: %.2f; GetFeedTime: %.2f", 391 406 // wallClockDelta, pStream->GetFeedTime()); 392 while ((wallClockDelta > (pStream->GetFeedTime())) &&407 while ((wallClockDelta + 1000 > (pStream->GetFeedTime() - _firstFeedTime)) && 393 408 (GETAVAILABLEBYTESCOUNT(_avData) > 8192)) { 394 409 if (!pTS->SignalInputData(_avData)) {
Note: See TracChangeset
for help on using the changeset viewer.
