{"action":"opened","number":192,"pull_request":{"url":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/192","id":58014261,"html_url":"https://github.com/kodi-pvr/pvr.hts/pull/192","diff_url":"https://github.com/kodi-pvr/pvr.hts/pull/192.diff","patch_url":"https://github.com/kodi-pvr/pvr.hts/pull/192.patch","issue_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/192","number":192,"state":"open","locked":false,"title":"Sanity check frames before triggering a stream change","user":{"login":"Jalle19","id":1106133,"avatar_url":"https://avatars.githubusercontent.com/u/1106133?v=3","gravatar_id":"","url":"https://api.github.com/users/Jalle19","html_url":"https://github.com/Jalle19","followers_url":"https://api.github.com/users/Jalle19/followers","following_url":"https://api.github.com/users/Jalle19/following{/other_user}","gists_url":"https://api.github.com/users/Jalle19/gists{/gist_id}","starred_url":"https://api.github.com/users/Jalle19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jalle19/subscriptions","organizations_url":"https://api.github.com/users/Jalle19/orgs","repos_url":"https://api.github.com/users/Jalle19/repos","events_url":"https://api.github.com/users/Jalle19/events{/privacy}","received_events_url":"https://api.github.com/users/Jalle19/received_events","type":"User","site_admin":false},"body":"Someone once told me that tvheadend makes sure that the first packet after a `subscriptionStart` message is guaranteed to be an I-frame. This is apparently not true (as can be seen with trace logging enabled).\r\n\r\nNormally, that shouldn't be such as a big deal, but for some reason, ffmpeg can throw `[mpeg2video] Invalid frame dimensions 0x0` even though the dimensions are correctly set in the metadata. I added some more logging during subscription starts so the video dimensions sent by tvheadend can be seen clearly. As can be seen from http://pastebin.com/ME9j7ZsQ, even though `PVR_STREAM::iWidth` and `PVR_STREAM::iHeight` are set to `720x576` the dimensions are later determined to be `0x0` by ffmpeg.\r\n\r\nThis is an attempt to fix that by making sure the next packet in the buffer after a stream change packet is always an I-frame.\r\n\r\n@perexg @FernetMenta @fritsch do you think this looks right or could there still be something I haven't accounted for?\r\n","created_at":"2016-02-02T16:45:41Z","updated_at":"2016-02-02T16:45:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/192/commits","review_comments_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/192/comments","review_comment_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/192/comments","statuses_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/statuses/1fa561dff00c38711edd960299d2225014aeb71a","head":{"label":"Jalle19:demuxer-frames","ref":"demuxer-frames","sha":"1fa561dff00c38711edd960299d2225014aeb71a","user":{"login":"Jalle19","id":1106133,"avatar_url":"https://avatars.githubusercontent.com/u/1106133?v=3","gravatar_id":"","url":"https://api.github.com/users/Jalle19","html_url":"https://github.com/Jalle19","followers_url":"https://api.github.com/users/Jalle19/followers","following_url":"https://api.github.com/users/Jalle19/following{/other_user}","gists_url":"https://api.github.com/users/Jalle19/gists{/gist_id}","starred_url":"https://api.github.com/users/Jalle19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jalle19/subscriptions","organizations_url":"https://api.github.com/users/Jalle19/orgs","repos_url":"https://api.github.com/users/Jalle19/repos","events_url":"https://api.github.com/users/Jalle19/events{/privacy}","received_events_url":"https://api.github.com/users/Jalle19/received_events","type":"User","site_admin":false},"repo":{"id":31707392,"name":"pvr.hts","full_name":"Jalle19/pvr.hts","owner":{"login":"Jalle19","id":1106133,"avatar_url":"https://avatars.githubusercontent.com/u/1106133?v=3","gravatar_id":"","url":"https://api.github.com/users/Jalle19","html_url":"https://github.com/Jalle19","followers_url":"https://api.github.com/users/Jalle19/followers","following_url":"https://api.github.com/users/Jalle19/following{/other_user}","gists_url":"https://api.github.com/users/Jalle19/gists{/gist_id}","starred_url":"https://api.github.com/users/Jalle19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jalle19/subscriptions","organizations_url":"https://api.github.com/users/Jalle19/orgs","repos_url":"https://api.github.com/users/Jalle19/repos","events_url":"https://api.github.com/users/Jalle19/events{/privacy}","received_events_url":"https://api.github.com/users/Jalle19/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jalle19/pvr.hts","description":"Kodi's Tvheadend HTSP client addon","fork":true,"url":"https://api.github.com/repos/Jalle19/pvr.hts","forks_url":"https://api.github.com/repos/Jalle19/pvr.hts/forks","keys_url":"https://api.github.com/repos/Jalle19/pvr.hts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jalle19/pvr.hts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jalle19/pvr.hts/teams","hooks_url":"https://api.github.com/repos/Jalle19/pvr.hts/hooks","issue_events_url":"https://api.github.com/repos/Jalle19/pvr.hts/issues/events{/number}","events_url":"https://api.github.com/repos/Jalle19/pvr.hts/events","assignees_url":"https://api.github.com/repos/Jalle19/pvr.hts/assignees{/user}","branches_url":"https://api.github.com/repos/Jalle19/pvr.hts/branches{/branch}","tags_url":"https://api.github.com/repos/Jalle19/pvr.hts/tags","blobs_url":"https://api.github.com/repos/Jalle19/pvr.hts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jalle19/pvr.hts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jalle19/pvr.hts/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jalle19/pvr.hts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jalle19/pvr.hts/statuses/{sha}","languages_url":"https://api.github.com/repos/Jalle19/pvr.hts/languages","stargazers_url":"https://api.github.com/repos/Jalle19/pvr.hts/stargazers","contributors_url":"https://api.github.com/repos/Jalle19/pvr.hts/contributors","subscribers_url":"https://api.github.com/repos/Jalle19/pvr.hts/subscribers","subscription_url":"https://api.github.com/repos/Jalle19/pvr.hts/subscription","commits_url":"https://api.github.com/repos/Jalle19/pvr.hts/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jalle19/pvr.hts/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jalle19/pvr.hts/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jalle19/pvr.hts/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jalle19/pvr.hts/contents/{+path}","compare_url":"https://api.github.com/repos/Jalle19/pvr.hts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jalle19/pvr.hts/merges","archive_url":"https://api.github.com/repos/Jalle19/pvr.hts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jalle19/pvr.hts/downloads","issues_url":"https://api.github.com/repos/Jalle19/pvr.hts/issues{/number}","pulls_url":"https://api.github.com/repos/Jalle19/pvr.hts/pulls{/number}","milestones_url":"https://api.github.com/repos/Jalle19/pvr.hts/milestones{/number}","notifications_url":"https://api.github.com/repos/Jalle19/pvr.hts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jalle19/pvr.hts/labels{/name}","releases_url":"https://api.github.com/repos/Jalle19/pvr.hts/releases{/id}","deployments_url":"https://api.github.com/repos/Jalle19/pvr.hts/deployments","created_at":"2015-03-05T09:55:19Z","updated_at":"2015-03-05T09:55:19Z","pushed_at":"2016-02-02T16:35:50Z","git_url":"git://github.com/Jalle19/pvr.hts.git","ssh_url":"git@github.com:Jalle19/pvr.hts.git","clone_url":"https://github.com/Jalle19/pvr.hts.git","svn_url":"https://github.com/Jalle19/pvr.hts","homepage":null,"size":1217,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"kodi-pvr:master","ref":"master","sha":"5eceedaa06b8f20fa8d67fdc6c09f034a288d660","user":{"login":"kodi-pvr","id":11259403,"avatar_url":"https://avatars.githubusercontent.com/u/11259403?v=3","gravatar_id":"","url":"https://api.github.com/users/kodi-pvr","html_url":"https://github.com/kodi-pvr","followers_url":"https://api.github.com/users/kodi-pvr/followers","following_url":"https://api.github.com/users/kodi-pvr/following{/other_user}","gists_url":"https://api.github.com/users/kodi-pvr/gists{/gist_id}","starred_url":"https://api.github.com/users/kodi-pvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodi-pvr/subscriptions","organizations_url":"https://api.github.com/users/kodi-pvr/orgs","repos_url":"https://api.github.com/users/kodi-pvr/repos","events_url":"https://api.github.com/users/kodi-pvr/events{/privacy}","received_events_url":"https://api.github.com/users/kodi-pvr/received_events","type":"Organization","site_admin":false},"repo":{"id":31268331,"name":"pvr.hts","full_name":"kodi-pvr/pvr.hts","owner":{"login":"kodi-pvr","id":11259403,"avatar_url":"https://avatars.githubusercontent.com/u/11259403?v=3","gravatar_id":"","url":"https://api.github.com/users/kodi-pvr","html_url":"https://github.com/kodi-pvr","followers_url":"https://api.github.com/users/kodi-pvr/followers","following_url":"https://api.github.com/users/kodi-pvr/following{/other_user}","gists_url":"https://api.github.com/users/kodi-pvr/gists{/gist_id}","starred_url":"https://api.github.com/users/kodi-pvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodi-pvr/subscriptions","organizations_url":"https://api.github.com/users/kodi-pvr/orgs","repos_url":"https://api.github.com/users/kodi-pvr/repos","events_url":"https://api.github.com/users/kodi-pvr/events{/privacy}","received_events_url":"https://api.github.com/users/kodi-pvr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kodi-pvr/pvr.hts","description":"Kodi's Tvheadend HTSP client addon","fork":false,"url":"https://api.github.com/repos/kodi-pvr/pvr.hts","forks_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/forks","keys_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/teams","hooks_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/hooks","issue_events_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/events{/number}","events_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/events","assignees_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/assignees{/user}","branches_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/branches{/branch}","tags_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/tags","blobs_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/git/refs{/sha}","trees_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/statuses/{sha}","languages_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/languages","stargazers_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/stargazers","contributors_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/contributors","subscribers_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/subscribers","subscription_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/subscription","commits_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/commits{/sha}","git_commits_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/git/commits{/sha}","comments_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/comments{/number}","issue_comment_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/comments{/number}","contents_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/contents/{+path}","compare_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/merges","archive_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/downloads","issues_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues{/number}","pulls_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls{/number}","milestones_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/milestones{/number}","notifications_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/labels{/name}","releases_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/releases{/id}","deployments_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/deployments","created_at":"2015-02-24T16:07:43Z","updated_at":"2016-02-01T16:30:51Z","pushed_at":"2016-01-31T19:39:26Z","git_url":"git://github.com/kodi-pvr/pvr.hts.git","ssh_url":"git@github.com:kodi-pvr/pvr.hts.git","clone_url":"https://github.com/kodi-pvr/pvr.hts.git","svn_url":"https://github.com/kodi-pvr/pvr.hts","homepage":null,"size":1464,"stargazers_count":33,"watchers_count":33,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":12,"forks":32,"open_issues":12,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/192"},"html":{"href":"https://github.com/kodi-pvr/pvr.hts/pull/192"},"issue":{"href":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/192"},"comments":{"href":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/192/comments"},"review_comments":{"href":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/192/comments"},"review_comment":{"href":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kodi-pvr/pvr.hts/pulls/192/commits"},"statuses":{"href":"https://api.github.com/repos/kodi-pvr/pvr.hts/statuses/1fa561dff00c38711edd960299d2225014aeb71a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":28,"deletions":19,"changed_files":2}}