{"action":"created","comment":{"url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/comments/30962414","id":30962414,"diff_hunk":"@@ -144,8 +159,64 @@ package com.kaltura.hls.m2ts\n             \n             return true;\n         }\n-\n-        public function append(packet:PESPacket):Boolean\n+\t\t\n+\t\tpublic function indexOf(bytes:ByteArray, search:String, startOffset:uint = 0):Number\n+\t\t{\n+\t\t\tif (bytes == null || bytes.length == 0) {\n+\t\t\t\tthrow new ArgumentError(\"bytes parameter should not be null or empty\");\n+\t\t\t}\n+\t\t\t\n+\t\t\tif (search == null || search.length == 0) {\n+\t\t\t\tthrow new ArgumentError(\"search parameter should not be null or empty\");\n+\t\t\t}\n+\t\t\t\n+\t\t\t// Fast return is the search pattern length is shorter than the bytes one\n+\t\t\tif (bytes.length < startOffset + search.length) {\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\t\n+\t\t\t// Create the pattern\n+\t\t\tvar pattern:ByteArray = new ByteArray();\n+\t\t\tpattern.writeUTFBytes(search);\n+\t\t\t\n+\t\t\t// Initialize loop variables\n+\t\t\tvar end:Boolean;\n+\t\t\tvar found:Boolean;\n+\t\t\tvar i:uint = startOffset;\n+\t\t\tvar j:uint = 0;\n+\t\t\tvar p:uint = pattern.length;\n+\t\t\tvar n:uint = bytes.length - p;\n+\t\t\t\n+\t\t\t// Repeat util end\n+\t\t\tdo {\n+\t\t\t\t// Compare the current byte with the first one of the pattern\n+\t\t\t\tif (bytes[i] == pattern[0]) {\n+\t\t\t\t\tfound = true;\n+\t\t\t\t\tj = p;\n+\t\t\t\t\t\n+\t\t\t\t\t// Loop through every byte of the pattern\n+\t\t\t\t\twhile (--j) {\n+\t\t\t\t\t\tif (bytes[i + j] != pattern[j]) {\n+\t\t\t\t\t\t\tfound = false;\n+\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t\t\n+\t\t\t\t\t// Return the pattern position\n+\t\t\t\t\tif (found) {\n+\t\t\t\t\t\treturn i;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\t\n+\t\t\t\t// Check if end is reach\n+\t\t\t\tend = (++i > n);","path":"HLSPlugin/src/com/kaltura/hls/m2ts/PESProcessor.as","position":118,"original_position":118,"commit_id":"9e67593dea97ef176f446b50f65f2039ae390dd6","original_commit_id":"9e67593dea97ef176f446b50f65f2039ae390dd6","user":{"login":"bengarney","id":132844,"avatar_url":"https://avatars.githubusercontent.com/u/132844?v=3","gravatar_id":"","url":"https://api.github.com/users/bengarney","html_url":"https://github.com/bengarney","followers_url":"https://api.github.com/users/bengarney/followers","following_url":"https://api.github.com/users/bengarney/following{/other_user}","gists_url":"https://api.github.com/users/bengarney/gists{/gist_id}","starred_url":"https://api.github.com/users/bengarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengarney/subscriptions","organizations_url":"https://api.github.com/users/bengarney/orgs","repos_url":"https://api.github.com/users/bengarney/repos","events_url":"https://api.github.com/users/bengarney/events{/privacy}","received_events_url":"https://api.github.com/users/bengarney/received_events","type":"User","site_admin":false},"body":"Should this just be in the while clause? It seems it's not ever used elsewhere.","created_at":"2015-05-25T05:11:34Z","updated_at":"2015-05-25T05:11:34Z","html_url":"https://github.com/kaltura/HLS-OSMF/pull/110#discussion_r30962414","pull_request_url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/comments/30962414"},"html":{"href":"https://github.com/kaltura/HLS-OSMF/pull/110#discussion_r30962414"},"pull_request":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110","id":36107350,"html_url":"https://github.com/kaltura/HLS-OSMF/pull/110","diff_url":"https://github.com/kaltura/HLS-OSMF/pull/110.diff","patch_url":"https://github.com/kaltura/HLS-OSMF/pull/110.patch","issue_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/110","number":110,"state":"open","locked":false,"title":"Id3 parse <<Not ready for merge>>","user":{"login":"itaykinnrot","id":555225,"avatar_url":"https://avatars.githubusercontent.com/u/555225?v=3","gravatar_id":"","url":"https://api.github.com/users/itaykinnrot","html_url":"https://github.com/itaykinnrot","followers_url":"https://api.github.com/users/itaykinnrot/followers","following_url":"https://api.github.com/users/itaykinnrot/following{/other_user}","gists_url":"https://api.github.com/users/itaykinnrot/gists{/gist_id}","starred_url":"https://api.github.com/users/itaykinnrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itaykinnrot/subscriptions","organizations_url":"https://api.github.com/users/itaykinnrot/orgs","repos_url":"https://api.github.com/users/itaykinnrot/repos","events_url":"https://api.github.com/users/itaykinnrot/events{/privacy}","received_events_url":"https://api.github.com/users/itaykinnrot/received_events","type":"User","site_admin":false},"body":"* Search for ID3 stream inside the ts\r\n* Add flv data - ONID3Data to allow sending the data to the JS.\r\n\r\n@bengarney  lets review it together on our call.\r\n@mdale  FYI this code allow to through the ID3 data to the JS side and get the url.","created_at":"2015-05-24T19:41:24Z","updated_at":"2015-05-25T05:11:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1743f0d8d6cc9eaea6af6b3d1c34a95540205414","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110/commits","review_comments_url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110/comments","review_comment_url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/110/comments","statuses_url":"https://api.github.com/repos/kaltura/HLS-OSMF/statuses/9e67593dea97ef176f446b50f65f2039ae390dd6","head":{"label":"kaltura:ID3-parse","ref":"ID3-parse","sha":"9e67593dea97ef176f446b50f65f2039ae390dd6","user":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"repo":{"id":17934994,"name":"HLS-OSMF","full_name":"kaltura/HLS-OSMF","owner":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaltura/HLS-OSMF","description":"HLS OSMF plugin - help to view m3u8 streams in the KDP/V2 player","fork":false,"url":"https://api.github.com/repos/kaltura/HLS-OSMF","forks_url":"https://api.github.com/repos/kaltura/HLS-OSMF/forks","keys_url":"https://api.github.com/repos/kaltura/HLS-OSMF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaltura/HLS-OSMF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaltura/HLS-OSMF/teams","hooks_url":"https://api.github.com/repos/kaltura/HLS-OSMF/hooks","issue_events_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/events{/number}","events_url":"https://api.github.com/repos/kaltura/HLS-OSMF/events","assignees_url":"https://api.github.com/repos/kaltura/HLS-OSMF/assignees{/user}","branches_url":"https://api.github.com/repos/kaltura/HLS-OSMF/branches{/branch}","tags_url":"https://api.github.com/repos/kaltura/HLS-OSMF/tags","blobs_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaltura/HLS-OSMF/statuses/{sha}","languages_url":"https://api.github.com/repos/kaltura/HLS-OSMF/languages","stargazers_url":"https://api.github.com/repos/kaltura/HLS-OSMF/stargazers","contributors_url":"https://api.github.com/repos/kaltura/HLS-OSMF/contributors","subscribers_url":"https://api.github.com/repos/kaltura/HLS-OSMF/subscribers","subscription_url":"https://api.github.com/repos/kaltura/HLS-OSMF/subscription","commits_url":"https://api.github.com/repos/kaltura/HLS-OSMF/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaltura/HLS-OSMF/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaltura/HLS-OSMF/contents/{+path}","compare_url":"https://api.github.com/repos/kaltura/HLS-OSMF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaltura/HLS-OSMF/merges","archive_url":"https://api.github.com/repos/kaltura/HLS-OSMF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaltura/HLS-OSMF/downloads","issues_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues{/number}","pulls_url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls{/number}","milestones_url":"https://api.github.com/repos/kaltura/HLS-OSMF/milestones{/number}","notifications_url":"https://api.github.com/repos/kaltura/HLS-OSMF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaltura/HLS-OSMF/labels{/name}","releases_url":"https://api.github.com/repos/kaltura/HLS-OSMF/releases{/id}","created_at":"2014-03-20T08:08:12Z","updated_at":"2015-05-07T11:05:38Z","pushed_at":"2015-05-24T19:41:25Z","git_url":"git://github.com/kaltura/HLS-OSMF.git","ssh_url":"git@github.com:kaltura/HLS-OSMF.git","clone_url":"https://github.com/kaltura/HLS-OSMF.git","svn_url":"https://github.com/kaltura/HLS-OSMF","homepage":null,"size":6505,"stargazers_count":2,"watchers_count":2,"language":"ActionScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"kaltura:FastAESKey","ref":"FastAESKey","sha":"79a66c4e163e35d29adb8fc7209e978414058436","user":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"repo":{"id":17934994,"name":"HLS-OSMF","full_name":"kaltura/HLS-OSMF","owner":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaltura/HLS-OSMF","description":"HLS OSMF plugin - help to view m3u8 streams in the KDP/V2 player","fork":false,"url":"https://api.github.com/repos/kaltura/HLS-OSMF","forks_url":"https://api.github.com/repos/kaltura/HLS-OSMF/forks","keys_url":"https://api.github.com/repos/kaltura/HLS-OSMF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaltura/HLS-OSMF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaltura/HLS-OSMF/teams","hooks_url":"https://api.github.com/repos/kaltura/HLS-OSMF/hooks","issue_events_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/events{/number}","events_url":"https://api.github.com/repos/kaltura/HLS-OSMF/events","assignees_url":"https://api.github.com/repos/kaltura/HLS-OSMF/assignees{/user}","branches_url":"https://api.github.com/repos/kaltura/HLS-OSMF/branches{/branch}","tags_url":"https://api.github.com/repos/kaltura/HLS-OSMF/tags","blobs_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaltura/HLS-OSMF/statuses/{sha}","languages_url":"https://api.github.com/repos/kaltura/HLS-OSMF/languages","stargazers_url":"https://api.github.com/repos/kaltura/HLS-OSMF/stargazers","contributors_url":"https://api.github.com/repos/kaltura/HLS-OSMF/contributors","subscribers_url":"https://api.github.com/repos/kaltura/HLS-OSMF/subscribers","subscription_url":"https://api.github.com/repos/kaltura/HLS-OSMF/subscription","commits_url":"https://api.github.com/repos/kaltura/HLS-OSMF/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaltura/HLS-OSMF/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaltura/HLS-OSMF/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaltura/HLS-OSMF/contents/{+path}","compare_url":"https://api.github.com/repos/kaltura/HLS-OSMF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaltura/HLS-OSMF/merges","archive_url":"https://api.github.com/repos/kaltura/HLS-OSMF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaltura/HLS-OSMF/downloads","issues_url":"https://api.github.com/repos/kaltura/HLS-OSMF/issues{/number}","pulls_url":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls{/number}","milestones_url":"https://api.github.com/repos/kaltura/HLS-OSMF/milestones{/number}","notifications_url":"https://api.github.com/repos/kaltura/HLS-OSMF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaltura/HLS-OSMF/labels{/name}","releases_url":"https://api.github.com/repos/kaltura/HLS-OSMF/releases{/id}","created_at":"2014-03-20T08:08:12Z","updated_at":"2015-05-07T11:05:38Z","pushed_at":"2015-05-24T19:41:25Z","git_url":"git://github.com/kaltura/HLS-OSMF.git","ssh_url":"git@github.com:kaltura/HLS-OSMF.git","clone_url":"https://github.com/kaltura/HLS-OSMF.git","svn_url":"https://github.com/kaltura/HLS-OSMF","homepage":null,"size":6505,"stargazers_count":2,"watchers_count":2,"language":"ActionScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110"},"html":{"href":"https://github.com/kaltura/HLS-OSMF/pull/110"},"issue":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/110"},"comments":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/kaltura/HLS-OSMF/statuses/9e67593dea97ef176f446b50f65f2039ae390dd6"}}}}