 
                 //find idx for next tag not matching with _fragMainLevelNetStream/_fragMainSNNetStream
                 for(var i : int = _videoIdx; i < _videoTags.length ; i++) {
-                    var tagData : FLVData = _videoTags[_videoIdx];
-                    if(tagData.fragLevel != _fragMainSNNetStream ||tagData.fragSN != _fragMainLevelNetStream) {
+                    var tagData : FLVData = _videoTags[i];
+                    if(tagData.fragLevel != _fragMainLevelNetStream ||tagData.fragSN != _fragMainSNNetStream) {
                         CONFIG::LOGGING {
                             Log.debug("first video FLV tag from next frag is @ " + i + " of [" + _videoIdx + "," + (_videoTags.length-1) + "]");
                         }

        private var _fragAltAudioLevel : int, _fragAltAudioSN : int;
        private var _fragAltAudioInitialContinuity : int,_fragAltAudioInitialStartPosition : Number,_fragAltAudioInitialPTS : Number;
        private var _fragMainIdx : uint,  _fragAltAudioIdx : uint;
        /** playlist duration **/
        private var _playlistDuration : Number = 0;
        /** requested start position (absolute position) **/

                            CONFIG::LOGGING {
                                Log.debug("StreamBuffer:lastFrag defined, flush buffer and seekFromLastFrag");
                            }
                            // flush all video tags not injected into NetStream, from next fragment onwards
                            _videoTags.splice(i, _videoTags.length-i);
                            // flush all audio tags from next main fragment onwards
                            _filteringStartIdx = _audioIdx;
                            _audioTags = _audioTags.filter(filternextFragments);
                            // flush all header tags from next main fragment onwards
                            _filteringStartIdx = _headerIdx;
                            _headerTags = _headerTags.filter(filternextFragments);
                            // flush all metadata tags from next main fragment onwards
                            _filteringStartIdx = _metaIdx;
                            _metaTags = _metaTags.filter(filternextFragments);
                            // stop any load in progress ...
                            _fragmentLoader.stop();
                            // seek position is out of buffer : load after fragment
