         }
 
         /*
-         * retrieve queue containing next tag to be injected, using the following priority :
+         * retrieve next tag and update pointer, using the following priority :
          * smallest continuity
          * then smallest dts
          * then header  then video then audio then metadata tags
          */
-        private function getnexttag() : FLVData {
+        private function shiftnexttag() : FLVData {
             var mtag : FLVData ,vtag : FLVData,atag : FLVData, htag : FLVData;
 
             var continuity : int = int.MAX_VALUE;

                    if (tag_offset - min_offset > max_duration) {
                        break;
                    }
                } while ((tag = getnexttag()) != null);
            }
            return tags;
        }

//                CONFIG::LOGGING {
//                    Log.debug2('append type/dts/pts:' + tag.typeString + '/' + tag.dts + '/' + tag.pts);
//                }

                var pos : Number = start_position + (tag.pts - min_pts) / 1000;
                var tagData : FLVData = new FLVData(tag, pos, _time_sliding, continuity);
                switch(tag.type) {
