{"action":"created","comment":{"url":"https://api.github.com/repos/google/shaka-player/pulls/comments/57759618","id":57759618,"diff_hunk":"@@ -129,9 +129,24 @@ shaka.media.SegmentIndex.prototype.merge = function(references) {\n       shaka.log.warning('Refusing to rewrite original references on update!');\n       j++;\n     } else {\n-      // Drop the new reference if there's an old reference with the same\n-      // time.\n-      newReferences.push(r1);\n+      // when period is changed, fitSegmentReference will\n+      // expand last segment to the start of the next the period","path":"lib/media/segment_index.js","position":8,"original_position":8,"commit_id":"862334e3ea91476ef556d0ad7247ab2f5503861e","original_commit_id":"862334e3ea91476ef556d0ad7247ab2f5503861e","user":{"login":"tdrews","id":10248471,"avatar_url":"https://avatars.githubusercontent.com/u/10248471?v=3","gravatar_id":"","url":"https://api.github.com/users/tdrews","html_url":"https://github.com/tdrews","followers_url":"https://api.github.com/users/tdrews/followers","following_url":"https://api.github.com/users/tdrews/following{/other_user}","gists_url":"https://api.github.com/users/tdrews/gists{/gist_id}","starred_url":"https://api.github.com/users/tdrews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdrews/subscriptions","organizations_url":"https://api.github.com/users/tdrews/orgs","repos_url":"https://api.github.com/users/tdrews/repos","events_url":"https://api.github.com/users/tdrews/events{/privacy}","received_events_url":"https://api.github.com/users/tdrews/received_events","type":"User","site_admin":false},"body":"typo: double \"the\".","created_at":"2016-03-29T17:01:37Z","updated_at":"2016-03-29T17:01:37Z","html_url":"https://github.com/google/shaka-player/pull/315#discussion_r57759618","pull_request_url":"https://api.github.com/repos/google/shaka-player/pulls/315","_links":{"self":{"href":"https://api.github.com/repos/google/shaka-player/pulls/comments/57759618"},"html":{"href":"https://github.com/google/shaka-player/pull/315#discussion_r57759618"},"pull_request":{"href":"https://api.github.com/repos/google/shaka-player/pulls/315"}}},"pull_request":{"url":"https://api.github.com/repos/google/shaka-player/pulls/315","id":64430376,"html_url":"https://github.com/google/shaka-player/pull/315","diff_url":"https://github.com/google/shaka-player/pull/315.diff","patch_url":"https://github.com/google/shaka-player/pull/315.patch","issue_url":"https://api.github.com/repos/google/shaka-player/issues/315","number":315,"state":"open","locked":false,"title":"Reproduce an issue with merging last segment in a period","user":{"login":"cmgrecu","id":17875591,"avatar_url":"https://avatars.githubusercontent.com/u/17875591?v=3","gravatar_id":"","url":"https://api.github.com/users/cmgrecu","html_url":"https://github.com/cmgrecu","followers_url":"https://api.github.com/users/cmgrecu/followers","following_url":"https://api.github.com/users/cmgrecu/following{/other_user}","gists_url":"https://api.github.com/users/cmgrecu/gists{/gist_id}","starred_url":"https://api.github.com/users/cmgrecu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmgrecu/subscriptions","organizations_url":"https://api.github.com/users/cmgrecu/orgs","repos_url":"https://api.github.com/users/cmgrecu/repos","events_url":"https://api.github.com/users/cmgrecu/events{/privacy}","received_events_url":"https://api.github.com/users/cmgrecu/received_events","type":"User","site_admin":false},"body":"Hi,\r\nI have a multi period live stream and, at some time shaka was stopping with an INVALID_SEGMENT_INDEX error.\r\n\r\nI discovered that the issue was caused by the fact that when segment references are merged at the manifest change, some of the segments are skipped, considered to be duplicates of the previous received segments. This is true in general, but when the period changes, last segment is expanded to end of the period (in MpdUtils.fitSegmentReferences). This updated segment was not merged into the final segment list which was causing a gap.\r\n\r\nI added a unit test that reproduce the issue and I also made a fix for it. \r\n","created_at":"2016-03-29T08:34:21Z","updated_at":"2016-03-29T17:01:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46e033bd4e455762bca3c68506632f6a4e79fd7b","assignee":{"login":"tdrews","id":10248471,"avatar_url":"https://avatars.githubusercontent.com/u/10248471?v=3","gravatar_id":"","url":"https://api.github.com/users/tdrews","html_url":"https://github.com/tdrews","followers_url":"https://api.github.com/users/tdrews/followers","following_url":"https://api.github.com/users/tdrews/following{/other_user}","gists_url":"https://api.github.com/users/tdrews/gists{/gist_id}","starred_url":"https://api.github.com/users/tdrews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdrews/subscriptions","organizations_url":"https://api.github.com/users/tdrews/orgs","repos_url":"https://api.github.com/users/tdrews/repos","events_url":"https://api.github.com/users/tdrews/events{/privacy}","received_events_url":"https://api.github.com/users/tdrews/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/google/shaka-player/milestones/9","html_url":"https://github.com/google/shaka-player/milestones/v2.0-beta","labels_url":"https://api.github.com/repos/google/shaka-player/milestones/9/labels","id":1483775,"number":9,"title":"v2.0-beta","description":"Beta of v2.0, may not be at feature parity with v1.6 yet.","creator":{"login":"joeyparrish","id":6843156,"avatar_url":"https://avatars.githubusercontent.com/u/6843156?v=3","gravatar_id":"","url":"https://api.github.com/users/joeyparrish","html_url":"https://github.com/joeyparrish","followers_url":"https://api.github.com/users/joeyparrish/followers","following_url":"https://api.github.com/users/joeyparrish/following{/other_user}","gists_url":"https://api.github.com/users/joeyparrish/gists{/gist_id}","starred_url":"https://api.github.com/users/joeyparrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeyparrish/subscriptions","organizations_url":"https://api.github.com/users/joeyparrish/orgs","repos_url":"https://api.github.com/users/joeyparrish/repos","events_url":"https://api.github.com/users/joeyparrish/events{/privacy}","received_events_url":"https://api.github.com/users/joeyparrish/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":17,"state":"open","created_at":"2016-01-05T00:08:45Z","updated_at":"2016-03-29T16:59:07Z","due_on":"2016-03-31T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/google/shaka-player/pulls/315/commits","review_comments_url":"https://api.github.com/repos/google/shaka-player/pulls/315/comments","review_comment_url":"https://api.github.com/repos/google/shaka-player/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/shaka-player/issues/315/comments","statuses_url":"https://api.github.com/repos/google/shaka-player/statuses/862334e3ea91476ef556d0ad7247ab2f5503861e","head":{"label":"cmgrecu:master","ref":"master","sha":"862334e3ea91476ef556d0ad7247ab2f5503861e","user":{"login":"cmgrecu","id":17875591,"avatar_url":"https://avatars.githubusercontent.com/u/17875591?v=3","gravatar_id":"","url":"https://api.github.com/users/cmgrecu","html_url":"https://github.com/cmgrecu","followers_url":"https://api.github.com/users/cmgrecu/followers","following_url":"https://api.github.com/users/cmgrecu/following{/other_user}","gists_url":"https://api.github.com/users/cmgrecu/gists{/gist_id}","starred_url":"https://api.github.com/users/cmgrecu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmgrecu/subscriptions","organizations_url":"https://api.github.com/users/cmgrecu/orgs","repos_url":"https://api.github.com/users/cmgrecu/repos","events_url":"https://api.github.com/users/cmgrecu/events{/privacy}","received_events_url":"https://api.github.com/users/cmgrecu/received_events","type":"User","site_admin":false},"repo":{"id":54020645,"name":"shaka-player","full_name":"cmgrecu/shaka-player","owner":{"login":"cmgrecu","id":17875591,"avatar_url":"https://avatars.githubusercontent.com/u/17875591?v=3","gravatar_id":"","url":"https://api.github.com/users/cmgrecu","html_url":"https://github.com/cmgrecu","followers_url":"https://api.github.com/users/cmgrecu/followers","following_url":"https://api.github.com/users/cmgrecu/following{/other_user}","gists_url":"https://api.github.com/users/cmgrecu/gists{/gist_id}","starred_url":"https://api.github.com/users/cmgrecu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmgrecu/subscriptions","organizations_url":"https://api.github.com/users/cmgrecu/orgs","repos_url":"https://api.github.com/users/cmgrecu/repos","events_url":"https://api.github.com/users/cmgrecu/events{/privacy}","received_events_url":"https://api.github.com/users/cmgrecu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmgrecu/shaka-player","description":"JavaScript player library / DASH client / MSE-EME player","fork":true,"url":"https://api.github.com/repos/cmgrecu/shaka-player","forks_url":"https://api.github.com/repos/cmgrecu/shaka-player/forks","keys_url":"https://api.github.com/repos/cmgrecu/shaka-player/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmgrecu/shaka-player/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmgrecu/shaka-player/teams","hooks_url":"https://api.github.com/repos/cmgrecu/shaka-player/hooks","issue_events_url":"https://api.github.com/repos/cmgrecu/shaka-player/issues/events{/number}","events_url":"https://api.github.com/repos/cmgrecu/shaka-player/events","assignees_url":"https://api.github.com/repos/cmgrecu/shaka-player/assignees{/user}","branches_url":"https://api.github.com/repos/cmgrecu/shaka-player/branches{/branch}","tags_url":"https://api.github.com/repos/cmgrecu/shaka-player/tags","blobs_url":"https://api.github.com/repos/cmgrecu/shaka-player/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmgrecu/shaka-player/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmgrecu/shaka-player/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmgrecu/shaka-player/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmgrecu/shaka-player/statuses/{sha}","languages_url":"https://api.github.com/repos/cmgrecu/shaka-player/languages","stargazers_url":"https://api.github.com/repos/cmgrecu/shaka-player/stargazers","contributors_url":"https://api.github.com/repos/cmgrecu/shaka-player/contributors","subscribers_url":"https://api.github.com/repos/cmgrecu/shaka-player/subscribers","subscription_url":"https://api.github.com/repos/cmgrecu/shaka-player/subscription","commits_url":"https://api.github.com/repos/cmgrecu/shaka-player/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmgrecu/shaka-player/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmgrecu/shaka-player/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmgrecu/shaka-player/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmgrecu/shaka-player/contents/{+path}","compare_url":"https://api.github.com/repos/cmgrecu/shaka-player/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmgrecu/shaka-player/merges","archive_url":"https://api.github.com/repos/cmgrecu/shaka-player/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmgrecu/shaka-player/downloads","issues_url":"https://api.github.com/repos/cmgrecu/shaka-player/issues{/number}","pulls_url":"https://api.github.com/repos/cmgrecu/shaka-player/pulls{/number}","milestones_url":"https://api.github.com/repos/cmgrecu/shaka-player/milestones{/number}","notifications_url":"https://api.github.com/repos/cmgrecu/shaka-player/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmgrecu/shaka-player/labels{/name}","releases_url":"https://api.github.com/repos/cmgrecu/shaka-player/releases{/id}","deployments_url":"https://api.github.com/repos/cmgrecu/shaka-player/deployments","created_at":"2016-03-16T09:59:58Z","updated_at":"2016-03-16T09:59:59Z","pushed_at":"2016-03-29T10:33:56Z","git_url":"git://github.com/cmgrecu/shaka-player.git","ssh_url":"git@github.com:cmgrecu/shaka-player.git","clone_url":"https://github.com/cmgrecu/shaka-player.git","svn_url":"https://github.com/cmgrecu/shaka-player","homepage":"","size":25097,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"d7fb07ea7ec8fb13414525df21c46a7be4663059","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":28246472,"name":"shaka-player","full_name":"google/shaka-player","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/shaka-player","description":"JavaScript player library / DASH client / MSE-EME player","fork":false,"url":"https://api.github.com/repos/google/shaka-player","forks_url":"https://api.github.com/repos/google/shaka-player/forks","keys_url":"https://api.github.com/repos/google/shaka-player/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/shaka-player/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/shaka-player/teams","hooks_url":"https://api.github.com/repos/google/shaka-player/hooks","issue_events_url":"https://api.github.com/repos/google/shaka-player/issues/events{/number}","events_url":"https://api.github.com/repos/google/shaka-player/events","assignees_url":"https://api.github.com/repos/google/shaka-player/assignees{/user}","branches_url":"https://api.github.com/repos/google/shaka-player/branches{/branch}","tags_url":"https://api.github.com/repos/google/shaka-player/tags","blobs_url":"https://api.github.com/repos/google/shaka-player/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/shaka-player/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/shaka-player/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/shaka-player/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/shaka-player/statuses/{sha}","languages_url":"https://api.github.com/repos/google/shaka-player/languages","stargazers_url":"https://api.github.com/repos/google/shaka-player/stargazers","contributors_url":"https://api.github.com/repos/google/shaka-player/contributors","subscribers_url":"https://api.github.com/repos/google/shaka-player/subscribers","subscription_url":"https://api.github.com/repos/google/shaka-player/subscription","commits_url":"https://api.github.com/repos/google/shaka-player/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/shaka-player/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/shaka-player/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/shaka-player/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/shaka-player/contents/{+path}","compare_url":"https://api.github.com/repos/google/shaka-player/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/shaka-player/merges","archive_url":"https://api.github.com/repos/google/shaka-player/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/shaka-player/downloads","issues_url":"https://api.github.com/repos/google/shaka-player/issues{/number}","pulls_url":"https://api.github.com/repos/google/shaka-player/pulls{/number}","milestones_url":"https://api.github.com/repos/google/shaka-player/milestones{/number}","notifications_url":"https://api.github.com/repos/google/shaka-player/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/shaka-player/labels{/name}","releases_url":"https://api.github.com/repos/google/shaka-player/releases{/id}","deployments_url":"https://api.github.com/repos/google/shaka-player/deployments","created_at":"2014-12-19T21:12:18Z","updated_at":"2016-03-29T04:51:23Z","pushed_at":"2016-03-29T10:33:57Z","git_url":"git://github.com/google/shaka-player.git","ssh_url":"git@github.com:google/shaka-player.git","clone_url":"https://github.com/google/shaka-player.git","svn_url":"https://github.com/google/shaka-player","homepage":"","size":26015,"stargazers_count":543,"watchers_count":543,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":117,"mirror_url":null,"open_issues_count":33,"forks":117,"open_issues":33,"watchers":543,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/shaka-player/pulls/315"},"html":{"href":"https://github.com/google/shaka-player/pull/315"},"issue":{"href":"https://api.github.com/repos/google/shaka-player/issues/315"},"comments":{"href":"https://api.github.com/repos/google/shaka-player/issues/315/comments"},"review_comments":{"href":"https://api.github.com/repos/google/shaka-player/pulls/315/comments"},"review_comment":{"href":"https://api.github.com/repos/google/shaka-player/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/shaka-player/pulls/315/commits"},"statuses":{"href":"https://api.github.com/repos/google/shaka-player/statuses/862334e3ea91476ef556d0ad7247ab2f5503861e"}}}}