{"action":"closed","issue":{"url":"https://api.github.com/repos/video-dev/hls.js/issues/2014","repository_url":"https://api.github.com/repos/video-dev/hls.js","labels_url":"https://api.github.com/repos/video-dev/hls.js/issues/2014/labels{/name}","comments_url":"https://api.github.com/repos/video-dev/hls.js/issues/2014/comments","events_url":"https://api.github.com/repos/video-dev/hls.js/issues/2014/events","html_url":"https://github.com/video-dev/hls.js/issues/2014","id":384535312,"node_id":"MDU6SXNzdWUzODQ1MzUzMTI=","number":2014,"title":"Seeking back & buffering a new fragment after EOS causes loop loading on the last segment","user":{"login":"johnBartos","id":5042276,"node_id":"MDQ6VXNlcjUwNDIyNzY=","avatar_url":"https://avatars1.githubusercontent.com/u/5042276?v=4","gravatar_id":"","url":"https://api.github.com/users/johnBartos","html_url":"https://github.com/johnBartos","followers_url":"https://api.github.com/users/johnBartos/followers","following_url":"https://api.github.com/users/johnBartos/following{/other_user}","gists_url":"https://api.github.com/users/johnBartos/gists{/gist_id}","starred_url":"https://api.github.com/users/johnBartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnBartos/subscriptions","organizations_url":"https://api.github.com/users/johnBartos/orgs","repos_url":"https://api.github.com/users/johnBartos/repos","events_url":"https://api.github.com/users/johnBartos/events{/privacy}","received_events_url":"https://api.github.com/users/johnBartos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/video-dev/hls.js/milestones/7","html_url":"https://github.com/video-dev/hls.js/milestone/7","labels_url":"https://api.github.com/repos/video-dev/hls.js/milestones/7/labels","id":3565285,"node_id":"MDk6TWlsZXN0b25lMzU2NTI4NQ==","number":7,"title":"0.11.1","description":"","creator":{"login":"johnBartos","id":5042276,"node_id":"MDQ6VXNlcjUwNDIyNzY=","avatar_url":"https://avatars1.githubusercontent.com/u/5042276?v=4","gravatar_id":"","url":"https://api.github.com/users/johnBartos","html_url":"https://github.com/johnBartos","followers_url":"https://api.github.com/users/johnBartos/followers","following_url":"https://api.github.com/users/johnBartos/following{/other_user}","gists_url":"https://api.github.com/users/johnBartos/gists{/gist_id}","starred_url":"https://api.github.com/users/johnBartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnBartos/subscriptions","organizations_url":"https://api.github.com/users/johnBartos/orgs","repos_url":"https://api.github.com/users/johnBartos/repos","events_url":"https://api.github.com/users/johnBartos/events{/privacy}","received_events_url":"https://api.github.com/users/johnBartos/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":26,"state":"open","created_at":"2018-08-13T14:16:55Z","updated_at":"2018-12-12T16:02:59Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2018-11-26T22:19:20Z","updated_at":"2018-12-12T16:02:58Z","closed_at":"2018-12-12T16:02:58Z","author_association":"COLLABORATOR","body":"### What version of Hls.js are you using?\r\nLatest\r\n\r\n### What browser and OS are you using?\r\nChrome/MacOS\r\n\r\n### Test stream:\r\nhttps://s3.amazonaws.com/bob.jwplayer.com/~alex/121628/new_master.m3u8\r\n\r\n### Checklist\r\n<!-- Replace [ ] with [x] to check off the list -->\r\n- [x] The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues\r\n- [x] The issue occurs in the stable client on https://video-dev.github.io/hls.js/stable/demo and not just on my page\r\n<!-- The stable client is built from the latest release -->\r\n- [x] The issue occurs in the latest client on https://video-dev.github.io/hls.js/latest/demo and not just on my page\r\n<!-- The latest client is built from the head of the master branch -->\r\n- [x] The stream has correct Access-Control-Allow-Origin headers (CORS)\r\n- [x] There are no network errors such as 404s in the browser console when trying to play the stream\r\n\r\n### Steps to reproduce\r\n1. Seek to 1 segment length from the end quick enough so that at least the last 2 segments are unbuffered\r\n2. Seek back at least 2 segments form the end\r\n3. Observer that Hls.js loops loads the last segment\r\n\r\n### Expected behavior\r\nHls.js enters the `ENDED` state and ceases buffering/fragment finding\r\n\r\n### Actual behavior\r\nHls.js attempts to load the last segment in a loop, and remains in the idle state\r\n\r\n\r\n### Triage\r\n\r\nEntering the `ENDED` is dependent on `fragPrevious` being the last segment. If the last fragment is already buffered when seeking backwards, `fragPrevious` will never be the final fragment:\r\n\r\n```\r\n//stream-controller.js, line 246\r\n\r\n    let fragPrevious = this.fragPrevious;\r\n    if (!levelDetails.live && fragPrevious && !fragPrevious.backtracked && fragPrevious.sn === levelDetails.endSN && !bufferInfo.nextStart) {\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"johnBartos"}}