{"action":"created","comment":{"url":"https://api.github.com/repos/RustAudio/mp3/pulls/comments/209484041","pull_request_review_id":145505724,"id":209484041,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTQ4NDA0MQ==","diff_hunk":"@@ -0,0 +1,191 @@\n+use tables::*;\n+use Mp3Error;\n+\n+#[derive(Debug, Clone, PartialEq)]\n+pub enum Version {\n+    Mpeg2_5,\n+    Reserved,\n+    Mpeg2,\n+    Mpeg1,\n+}\n+\n+#[derive(Debug, Clone, PartialEq)]\n+pub enum Layer {\n+    LayerI,\n+    LayerII,\n+    LayerIII,\n+}\n+\n+#[derive(Debug, Clone, PartialEq)]\n+pub enum Mode {\n+    Stereo,\n+    JointStereo,\n+    DualChannel,\n+    Mono,\n+}\n+\n+/*\n+|------|----------------|------------------------------|\n+|      | Layer I and II |          Layer III           |\n+|------|----------------|------------------|-----------|\n+| bits |  Layer I & II  | Intensity Stereo | MS Stereo |\n+|------|----------------|------------------|-----------|\n+|  00  | bands 4 to 31  |        Off       |    Off    |\n+|  01  | bands 8 to 31  |        On        |    Off    |\n+|  10  | bands 12 to 31 |        Off       |    On     |\n+|  11  | bands 16 to 31 |        On        |    On     |\n+|------|----------------|------------------|-----------|\n+*/\n+#[derive(Debug, Clone, PartialEq)]\n+pub enum ModeExtension {\n+    Bands(u8),\n+    Stereo(bool, bool),\n+}\n+\n+#[derive(Debug, Clone, PartialEq)]\n+pub enum Emphasis {\n+    None,\n+    Ms50_15, // 50/15 ms\n+    Reserved,\n+    CcittJ17, // CCITT J.17\n+}\n+\n+#[derive(Debug, Clone, PartialEq)]\n+pub struct FrameHeader {\n+    // MPEG Audio version\n+    version: Version,\n+    // MPEG layer\n+    pub layer: Layer,\n+    // Indicates that frame is protected by CRC (16 bit CRC follows header).\n+    protection: bool,\n+    // Bit rate\n+    pub bitrate: u16,\n+    // Sampling rate\n+    pub sampling_rate: u16,\n+    // Indicates that frame is padded with one extra slot (32 bits for Layer I, 8 bits for others).\n+    pub padding: bool,\n+    // Bit for application-specific triggers.\n+    private: bool,\n+    // Channel Mode\n+    mode: Mode,\n+    // Only used in Joint stereo mode to join informations that are of no use for stereo effect.\n+    mode_extension: ModeExtension,\n+    // Indicates that audio is copyrighted.\n+    copyright: bool,\n+    // Indicates that the frame is located on its original media.\n+    original: bool,\n+    // Tells the decoder that the file must be de-emphasized. Rarely used.\n+    emphasis: Emphasis,\n+}\n+\n+pub fn parse_frame_header(data: &[u8]) -> Result<FrameHeader, Mp3Error> {\n+    let header = &data[..4];\n+\n+    // Sync word check\n+    if (header[0] != 0xff_u8) && (header[1] < 0xe0_u8) {","path":"src/header.rs","position":85,"original_position":85,"commit_id":"221b805ad38fdc4bfb182ef5852bf82a485903a7","original_commit_id":"221b805ad38fdc4bfb182ef5852bf82a485903a7","user":{"login":"est31","id":8872119,"node_id":"MDQ6VXNlcjg4NzIxMTk=","avatar_url":"https://avatars2.githubusercontent.com/u/8872119?v=4","gravatar_id":"","url":"https://api.github.com/users/est31","html_url":"https://github.com/est31","followers_url":"https://api.github.com/users/est31/followers","following_url":"https://api.github.com/users/est31/following{/other_user}","gists_url":"https://api.github.com/users/est31/gists{/gist_id}","starred_url":"https://api.github.com/users/est31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/est31/subscriptions","organizations_url":"https://api.github.com/users/est31/orgs","repos_url":"https://api.github.com/users/est31/repos","events_url":"https://api.github.com/users/est31/events{/privacy}","received_events_url":"https://api.github.com/users/est31/received_events","type":"User","site_admin":false},"body":"using < for this task is kind of a hack imo, especially as it can only be used in a signed environment with masks of 111's at the highest bits and 0 otherwise.","created_at":"2018-08-13T03:16:53Z","updated_at":"2018-08-13T03:16:53Z","html_url":"https://github.com/RustAudio/mp3/pull/4#discussion_r209484041","pull_request_url":"https://api.github.com/repos/RustAudio/mp3/pulls/4","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/RustAudio/mp3/pulls/comments/209484041"},"html":{"href":"https://github.com/RustAudio/mp3/pull/4#discussion_r209484041"},"pull_request":{"href":"https://api.github.com/repos/RustAudio/mp3/pulls/4"}},"in_reply_to_id":209479933},"pull_request":{"url":"https://api.github.com/repos/RustAudio/mp3/pulls/4","id":207029981,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MDI5OTgx","html_url":"https://github.com/RustAudio/mp3/pull/4","diff_url":"https://github.com/RustAudio/mp3/pull/4.diff","patch_url":"https://github.com/RustAudio/mp3/pull/4.patch","issue_url":"https://api.github.com/repos/RustAudio/mp3/issues/4","number":4,"state":"open","locked":false,"title":"Frame header parser and some help functions and tables.","user":{"login":"Tomarchelone","id":29727534,"node_id":"MDQ6VXNlcjI5NzI3NTM0","avatar_url":"https://avatars1.githubusercontent.com/u/29727534?v=4","gravatar_id":"","url":"https://api.github.com/users/Tomarchelone","html_url":"https://github.com/Tomarchelone","followers_url":"https://api.github.com/users/Tomarchelone/followers","following_url":"https://api.github.com/users/Tomarchelone/following{/other_user}","gists_url":"https://api.github.com/users/Tomarchelone/gists{/gist_id}","starred_url":"https://api.github.com/users/Tomarchelone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tomarchelone/subscriptions","organizations_url":"https://api.github.com/users/Tomarchelone/orgs","repos_url":"https://api.github.com/users/Tomarchelone/repos","events_url":"https://api.github.com/users/Tomarchelone/events{/privacy}","received_events_url":"https://api.github.com/users/Tomarchelone/received_events","type":"User","site_admin":false},"body":"Highly inspired by 'mptree' ('tables.rs' is a direct copy). I was told though that there might be license problems.\r\n\r\nAlso, this is my first ever attempt to contribute to open source, so feel free to correct me if I do something wrong.","created_at":"2018-08-08T14:36:03Z","updated_at":"2018-08-13T03:16:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f519c174f7ff029d6cc1130e1316d02ba9646ed","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/RustAudio/mp3/pulls/4/commits","review_comments_url":"https://api.github.com/repos/RustAudio/mp3/pulls/4/comments","review_comment_url":"https://api.github.com/repos/RustAudio/mp3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RustAudio/mp3/issues/4/comments","statuses_url":"https://api.github.com/repos/RustAudio/mp3/statuses/221b805ad38fdc4bfb182ef5852bf82a485903a7","head":{"label":"Tomarchelone:frame","ref":"frame","sha":"221b805ad38fdc4bfb182ef5852bf82a485903a7","user":{"login":"Tomarchelone","id":29727534,"node_id":"MDQ6VXNlcjI5NzI3NTM0","avatar_url":"https://avatars1.githubusercontent.com/u/29727534?v=4","gravatar_id":"","url":"https://api.github.com/users/Tomarchelone","html_url":"https://github.com/Tomarchelone","followers_url":"https://api.github.com/users/Tomarchelone/followers","following_url":"https://api.github.com/users/Tomarchelone/following{/other_user}","gists_url":"https://api.github.com/users/Tomarchelone/gists{/gist_id}","starred_url":"https://api.github.com/users/Tomarchelone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tomarchelone/subscriptions","organizations_url":"https://api.github.com/users/Tomarchelone/orgs","repos_url":"https://api.github.com/users/Tomarchelone/repos","events_url":"https://api.github.com/users/Tomarchelone/events{/privacy}","received_events_url":"https://api.github.com/users/Tomarchelone/received_events","type":"User","site_admin":false},"repo":{"id":143991971,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM5OTE5NzE=","name":"mp3","full_name":"Tomarchelone/mp3","owner":{"login":"Tomarchelone","id":29727534,"node_id":"MDQ6VXNlcjI5NzI3NTM0","avatar_url":"https://avatars1.githubusercontent.com/u/29727534?v=4","gravatar_id":"","url":"https://api.github.com/users/Tomarchelone","html_url":"https://github.com/Tomarchelone","followers_url":"https://api.github.com/users/Tomarchelone/followers","following_url":"https://api.github.com/users/Tomarchelone/following{/other_user}","gists_url":"https://api.github.com/users/Tomarchelone/gists{/gist_id}","starred_url":"https://api.github.com/users/Tomarchelone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tomarchelone/subscriptions","organizations_url":"https://api.github.com/users/Tomarchelone/orgs","repos_url":"https://api.github.com/users/Tomarchelone/repos","events_url":"https://api.github.com/users/Tomarchelone/events{/privacy}","received_events_url":"https://api.github.com/users/Tomarchelone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tomarchelone/mp3","description":"Rust MP3 decoder project","fork":true,"url":"https://api.github.com/repos/Tomarchelone/mp3","forks_url":"https://api.github.com/repos/Tomarchelone/mp3/forks","keys_url":"https://api.github.com/repos/Tomarchelone/mp3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tomarchelone/mp3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tomarchelone/mp3/teams","hooks_url":"https://api.github.com/repos/Tomarchelone/mp3/hooks","issue_events_url":"https://api.github.com/repos/Tomarchelone/mp3/issues/events{/number}","events_url":"https://api.github.com/repos/Tomarchelone/mp3/events","assignees_url":"https://api.github.com/repos/Tomarchelone/mp3/assignees{/user}","branches_url":"https://api.github.com/repos/Tomarchelone/mp3/branches{/branch}","tags_url":"https://api.github.com/repos/Tomarchelone/mp3/tags","blobs_url":"https://api.github.com/repos/Tomarchelone/mp3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tomarchelone/mp3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tomarchelone/mp3/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tomarchelone/mp3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tomarchelone/mp3/statuses/{sha}","languages_url":"https://api.github.com/repos/Tomarchelone/mp3/languages","stargazers_url":"https://api.github.com/repos/Tomarchelone/mp3/stargazers","contributors_url":"https://api.github.com/repos/Tomarchelone/mp3/contributors","subscribers_url":"https://api.github.com/repos/Tomarchelone/mp3/subscribers","subscription_url":"https://api.github.com/repos/Tomarchelone/mp3/subscription","commits_url":"https://api.github.com/repos/Tomarchelone/mp3/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tomarchelone/mp3/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tomarchelone/mp3/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tomarchelone/mp3/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tomarchelone/mp3/contents/{+path}","compare_url":"https://api.github.com/repos/Tomarchelone/mp3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tomarchelone/mp3/merges","archive_url":"https://api.github.com/repos/Tomarchelone/mp3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tomarchelone/mp3/downloads","issues_url":"https://api.github.com/repos/Tomarchelone/mp3/issues{/number}","pulls_url":"https://api.github.com/repos/Tomarchelone/mp3/pulls{/number}","milestones_url":"https://api.github.com/repos/Tomarchelone/mp3/milestones{/number}","notifications_url":"https://api.github.com/repos/Tomarchelone/mp3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tomarchelone/mp3/labels{/name}","releases_url":"https://api.github.com/repos/Tomarchelone/mp3/releases{/id}","deployments_url":"https://api.github.com/repos/Tomarchelone/mp3/deployments","created_at":"2018-08-08T09:32:40Z","updated_at":"2018-08-08T09:32:41Z","pushed_at":"2018-08-10T20:20:43Z","git_url":"git://github.com/Tomarchelone/mp3.git","ssh_url":"git@github.com:Tomarchelone/mp3.git","clone_url":"https://github.com/Tomarchelone/mp3.git","svn_url":"https://github.com/Tomarchelone/mp3","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RustAudio:master","ref":"master","sha":"6265b9d98091bbd14d200f5ab72820d98e03f574","user":{"login":"RustAudio","id":9999738,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5OTk3Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/9999738?v=4","gravatar_id":"","url":"https://api.github.com/users/RustAudio","html_url":"https://github.com/RustAudio","followers_url":"https://api.github.com/users/RustAudio/followers","following_url":"https://api.github.com/users/RustAudio/following{/other_user}","gists_url":"https://api.github.com/users/RustAudio/gists{/gist_id}","starred_url":"https://api.github.com/users/RustAudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RustAudio/subscriptions","organizations_url":"https://api.github.com/users/RustAudio/orgs","repos_url":"https://api.github.com/users/RustAudio/repos","events_url":"https://api.github.com/users/RustAudio/events{/privacy}","received_events_url":"https://api.github.com/users/RustAudio/received_events","type":"Organization","site_admin":false},"repo":{"id":119718426,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk3MTg0MjY=","name":"mp3","full_name":"RustAudio/mp3","owner":{"login":"RustAudio","id":9999738,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5OTk3Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/9999738?v=4","gravatar_id":"","url":"https://api.github.com/users/RustAudio","html_url":"https://github.com/RustAudio","followers_url":"https://api.github.com/users/RustAudio/followers","following_url":"https://api.github.com/users/RustAudio/following{/other_user}","gists_url":"https://api.github.com/users/RustAudio/gists{/gist_id}","starred_url":"https://api.github.com/users/RustAudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RustAudio/subscriptions","organizations_url":"https://api.github.com/users/RustAudio/orgs","repos_url":"https://api.github.com/users/RustAudio/repos","events_url":"https://api.github.com/users/RustAudio/events{/privacy}","received_events_url":"https://api.github.com/users/RustAudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RustAudio/mp3","description":"Rust MP3 decoder project","fork":false,"url":"https://api.github.com/repos/RustAudio/mp3","forks_url":"https://api.github.com/repos/RustAudio/mp3/forks","keys_url":"https://api.github.com/repos/RustAudio/mp3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RustAudio/mp3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RustAudio/mp3/teams","hooks_url":"https://api.github.com/repos/RustAudio/mp3/hooks","issue_events_url":"https://api.github.com/repos/RustAudio/mp3/issues/events{/number}","events_url":"https://api.github.com/repos/RustAudio/mp3/events","assignees_url":"https://api.github.com/repos/RustAudio/mp3/assignees{/user}","branches_url":"https://api.github.com/repos/RustAudio/mp3/branches{/branch}","tags_url":"https://api.github.com/repos/RustAudio/mp3/tags","blobs_url":"https://api.github.com/repos/RustAudio/mp3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RustAudio/mp3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RustAudio/mp3/git/refs{/sha}","trees_url":"https://api.github.com/repos/RustAudio/mp3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RustAudio/mp3/statuses/{sha}","languages_url":"https://api.github.com/repos/RustAudio/mp3/languages","stargazers_url":"https://api.github.com/repos/RustAudio/mp3/stargazers","contributors_url":"https://api.github.com/repos/RustAudio/mp3/contributors","subscribers_url":"https://api.github.com/repos/RustAudio/mp3/subscribers","subscription_url":"https://api.github.com/repos/RustAudio/mp3/subscription","commits_url":"https://api.github.com/repos/RustAudio/mp3/commits{/sha}","git_commits_url":"https://api.github.com/repos/RustAudio/mp3/git/commits{/sha}","comments_url":"https://api.github.com/repos/RustAudio/mp3/comments{/number}","issue_comment_url":"https://api.github.com/repos/RustAudio/mp3/issues/comments{/number}","contents_url":"https://api.github.com/repos/RustAudio/mp3/contents/{+path}","compare_url":"https://api.github.com/repos/RustAudio/mp3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RustAudio/mp3/merges","archive_url":"https://api.github.com/repos/RustAudio/mp3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RustAudio/mp3/downloads","issues_url":"https://api.github.com/repos/RustAudio/mp3/issues{/number}","pulls_url":"https://api.github.com/repos/RustAudio/mp3/pulls{/number}","milestones_url":"https://api.github.com/repos/RustAudio/mp3/milestones{/number}","notifications_url":"https://api.github.com/repos/RustAudio/mp3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RustAudio/mp3/labels{/name}","releases_url":"https://api.github.com/repos/RustAudio/mp3/releases{/id}","deployments_url":"https://api.github.com/repos/RustAudio/mp3/deployments","created_at":"2018-01-31T17:16:52Z","updated_at":"2018-08-07T19:53:26Z","pushed_at":"2018-08-10T20:20:45Z","git_url":"git://github.com/RustAudio/mp3.git","ssh_url":"git@github.com:RustAudio/mp3.git","clone_url":"https://github.com/RustAudio/mp3.git","svn_url":"https://github.com/RustAudio/mp3","homepage":null,"size":5,"stargazers_count":4,"watchers_count":4,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RustAudio/mp3/pulls/4"},"html":{"href":"https://github.com/RustAudio/mp3/pull/4"},"issue":{"href":"https://api.github.com/repos/RustAudio/mp3/issues/4"},"comments":{"href":"https://api.github.com/repos/RustAudio/mp3/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/RustAudio/mp3/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/RustAudio/mp3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RustAudio/mp3/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/RustAudio/mp3/statuses/221b805ad38fdc4bfb182ef5852bf82a485903a7"}},"author_association":"NONE"}}
{"actor":{"display_login":"est31"}}