                          * in case playlist of new level is outdated
                          * return 1 to retry loading later.
                          */
-                        return LOADING_WAITING;
+                        return LOADING_WAITING_LEVEL_UPDATE;
                     } else if (last_seqnum == -1) {
                         // if we are here, it means that we have no PTS info for this continuity index, we need to do some PTS probing to find the right seqnum
                         /* we need to perform PTS analysis on fragments from same continuity range

                    if ((_levels[level].fragments.length == 0) || (_hls.type == HLSTypes.LIVE && _last_loaded_level != level)) {
                        // playlist not yet received
                        CONFIG::LOGGING {
                            Log.debug("loadnextfragment : playlist not received for level:" + level);
                        }
                        loadstatus = LOADING_WAITING;
                    } else {
                        loadstatus = _loadnextfragment(_level, _frag_previous);
                    }
                } else {
                    // no need to load any new fragment, buffer is full already
                    return;
                }
                if (loadstatus == LOADING_IN_PROGRESS) {
                    // good, new fragment being loaded
                    _frag_loading = true;
                } else if (loadstatus == LOADING_OUTDATED) {
                    /* it means PTS requested is smaller than playlist start PTS.
                    it could happen on live playlist :
                    - if bandwidth available is lower than lowest quality needed bandwidth

            }

            // if previous key loading failed
            if (_loading_state == LOADING_KEY_IO_ERROR ) {
                // compare current date and next retry date.
                if (new Date().valueOf() >= _key_load_error_date) {
                    /* try to reload the key ...
                    calling _loadfragment will also reload key */
                    _loadfragment(_frag_current);
                    _loading_state = LOADING_IN_PROGRESS;
                }
                // in any case, exit from the loop
                return;
            }

            // if previous fragment loading failed
            if (_loading_state == LOADING_FRAGMENT_IO_ERROR) {
                // compare current date and next retry date.
                if (new Date().valueOf() >= _frag_load_error_date) {
                    /* try to reload the fragment ... */
                    _loadfragment(_frag_current);
                    _loading_state = LOADING_IN_PROGRESS;
                }
                // in any case, exit from the loop
                return;
            }

            // check fragment loading status, try to load a new fragment if needed
            if (_loading_state == LOADING_IDLE || _loading_state == LOADING_WAITING_LEVEL_UPDATE) {
                var level : int;
                // check if first fragment after seek has been already loaded
                if (_fragment_first_loaded == false) {
