- Timestamp:
- 08/25/10 00:20:41 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/applications/applestreamingclient/src/clientcontext.cpp
r103 r104 44 44 _pMasterPlaylist = NULL; 45 45 _parsedChildPlaylistsCount = 0; 46 _current ItemIndex= 0;46 _currentSequence = 0; 47 47 _optimalBw = 0; 48 48 _lastUsedBw = 0; … … 291 291 292 292 //4. Is this the last item in the playlis? 293 FINEST("---------------------------------------------------"); 294 if (_currentItemIndex >= pPlaylist->GetItemsCount()) { 295 if (ReloadPlaylist(optimalBw)) { 296 WARN("End of list. Wait one sec and try again"); 297 FINEST("---------------------------------------------------"); 298 return EnqueueFetchChildPlaylist(_childPlaylists[optimalBw]->GetPlaylistUri(), optimalBw); 299 } else { 300 WARN("No playlist reload"); 301 _currentItemIndex--; 302 } 303 } 304 FINEST("_currentItemIndex: %d", _currentItemIndex); 305 FINEST("---------------------------------------------------"); 293 string uri = pPlaylist->GetItemUri(_currentSequence); 294 if (uri == "") { 295 FINEST("---------------------------------------------------"); 296 WARN("End of list. Wait one sec and try again"); 297 FINEST("---------------------------------------------------"); 298 return EnqueueFetchChildPlaylist(_childPlaylists[optimalBw]->GetPlaylistUri(), optimalBw); 299 } 306 300 307 301 //4. Get the item URI and the key URI if available 308 string uri = pPlaylist->GetItemUri(_currentItemIndex); 309 string keyUri = pPlaylist->GetItemKeyUri(_currentItemIndex); 310 _mediaSequences[optimalBw] = pPlaylist->GetItemMediaSequence(_currentItemIndex); 302 string keyUri = pPlaylist->GetItemKeyUri(_currentSequence); 311 303 if (keyUri != "") 312 304 keyUri += "&" + _connectingString.sessionId; … … 402 394 //7. Done 403 395 return true; 404 }405 406 bool ClientContext::ReloadPlaylist(uint32_t bw) {407 if (!MAP_HAS1(_mediaSequences, bw)) {408 FINEST("bw %d not in _mediaSequences", bw);409 return true;410 }411 if (!MAP_HAS1(_childPlaylists, bw)) {412 FINEST("bw %d not in playlists", bw);413 return true;414 }415 416 uint32_t lastSequence = _mediaSequences[bw];417 FINEST("lastSequence: %d", lastSequence);418 uint32_t playlistSequnece = _childPlaylists[bw]->GetLastMediaSequence();419 FINEST("playlistSequnece: %d", playlistSequnece);420 421 return lastSequence == playlistSequnece;422 396 } 423 397 … … 547 521 string itemUri = parameters["payload"]["itemUri"]; 548 522 uint32_t bw = parameters["payload"]["bw"]; 549 uint64_t iv = _c hildPlaylists[bw]->GetItemMediaSequence(_currentItemIndex);523 uint64_t iv = _currentSequence; 550 524 //FINEST("itemUri: %s; bw: %d; key: %s", STR(itemUri), bw, STR(key)); 551 525 … … 563 537 564 538 bool ClientContext::SignalTSChunkComplete(uint32_t bw) { 565 _current ItemIndex++;539 _currentSequence++; 566 540 return StartFeeding(); 567 541 }
Note: See TracChangeset
for help on using the changeset viewer.
