Ignore:
Timestamp:
08/25/10 00:20:41 (21 months ago)
Author:
shiretu
Message:

-- fixed rolling file appender

File:
1 edited

Legend:

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

    r103 r104  
    4444        _pMasterPlaylist = NULL; 
    4545        _parsedChildPlaylistsCount = 0; 
    46         _currentItemIndex = 0; 
     46        _currentSequence = 0; 
    4747        _optimalBw = 0; 
    4848        _lastUsedBw = 0; 
     
    291291 
    292292        //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        } 
    306300 
    307301        //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); 
    311303        if (keyUri != "") 
    312304                keyUri += "&" + _connectingString.sessionId; 
     
    402394        //7. Done 
    403395        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; 
    422396} 
    423397 
     
    547521        string itemUri = parameters["payload"]["itemUri"]; 
    548522        uint32_t bw = parameters["payload"]["bw"]; 
    549         uint64_t iv = _childPlaylists[bw]->GetItemMediaSequence(_currentItemIndex); 
     523        uint64_t iv = _currentSequence; 
    550524        //FINEST("itemUri: %s; bw: %d; key: %s", STR(itemUri), bw, STR(key)); 
    551525 
     
    563537 
    564538bool ClientContext::SignalTSChunkComplete(uint32_t bw) { 
    565         _currentItemIndex++; 
     539        _currentSequence++; 
    566540        return StartFeeding(); 
    567541} 
Note: See TracChangeset for help on using the changeset viewer.