     public class BufferThresholdController {
         /** Reference to the HLS controller. **/
         private var _hls : HLS;
-        // max nb of samples used for bw checking. the bigger it is, the more conservative it is.
-        private static const MAX_SAMPLES : int = 30;
-        private var _bw : Vector.<Number>;
-        private var _nbSamples : uint;
         private var _targetduration : Number;
         private var _minBufferLength : Number;
 

        }

        private function _manifestLoadedHandler(event : HLSEvent) : void {
            _nbSamples = 0;
            _targetduration = event.levels[_hls.startLevel].targetduration;
            _bw = new Vector.<Number>(MAX_SAMPLES,true);
            _minBufferLength = _targetduration;
        };


            var metrics : HLSLoadMetrics = event.loadMetrics;
            // only monitor main fragment metrics for buffer threshold computing
            if(metrics.type == HLSLoaderTypes.FRAGMENT_MAIN) {
                /* set min buf len to be the time to process a complete segment, using current processing rate */
                _minBufferLength = metrics.processing_duration * (_targetduration / metrics.duration);
                // avoid min > max
                if (HLSSettings.maxBufferLength) {
                    _minBufferLength = Math.min(HLSSettings.maxBufferLength, _minBufferLength);
