{"action":"created","comment":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/39716767","id":39716767,"diff_hunk":"@@ -222,11 +222,20 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight)\n RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RESOLUTION current, float& weight)\n {\n   RESOLUTION_INFO curr = g_graphicsContext.GetResInfo(current);\n+  RESOLUTION orig_res  = CDisplaySettings::GetInstance().GetCurrentResolution();\n+\n+  if (orig_res <= RES_DESKTOP)\n+    orig_res = RES_DESKTOP;\n+\n+  RESOLUTION_INFO orig = g_graphicsContext.GetResInfo(orig_res);\n \n   float fRefreshRate = fps;\n \n   float last_diff = fRefreshRate;\n \n+  int curr_diff = std::abs((int) m_sourceWidth - curr.iScreenWidth);","path":"xbmc/cores/VideoRenderers/BaseRenderer.cpp","position":15,"original_position":15,"commit_id":"36791fcc28cd7fede060ca6edee69ae22c027230","original_commit_id":"36791fcc28cd7fede060ca6edee69ae22c027230","user":{"login":"FernetMenta","id":576009,"avatar_url":"https://avatars.githubusercontent.com/u/576009?v=3","gravatar_id":"","url":"https://api.github.com/users/FernetMenta","html_url":"https://github.com/FernetMenta","followers_url":"https://api.github.com/users/FernetMenta/followers","following_url":"https://api.github.com/users/FernetMenta/following{/other_user}","gists_url":"https://api.github.com/users/FernetMenta/gists{/gist_id}","starred_url":"https://api.github.com/users/FernetMenta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FernetMenta/subscriptions","organizations_url":"https://api.github.com/users/FernetMenta/orgs","repos_url":"https://api.github.com/users/FernetMenta/repos","events_url":"https://api.github.com/users/FernetMenta/events{/privacy}","received_events_url":"https://api.github.com/users/FernetMenta/received_events","type":"User","site_admin":false},"body":"don't you miss some parenthesis? you cast the first parameter to int, then subtract float. ","created_at":"2015-09-17T07:16:45Z","updated_at":"2015-09-17T07:16:45Z","html_url":"https://github.com/xbmc/xbmc/pull/8031#discussion_r39716767","pull_request_url":"https://api.github.com/repos/xbmc/xbmc/pulls/8031","_links":{"self":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/39716767"},"html":{"href":"https://github.com/xbmc/xbmc/pull/8031#discussion_r39716767"},"pull_request":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8031"}}},"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/8031","id":44859523,"html_url":"https://github.com/xbmc/xbmc/pull/8031","diff_url":"https://github.com/xbmc/xbmc/pull/8031.diff","patch_url":"https://github.com/xbmc/xbmc/pull/8031.patch","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/8031","number":8031,"state":"open","locked":false,"title":"AdjustRefreshrate: Switch to higher resolution depending on source dims","user":{"login":"fritsch","id":1089309,"avatar_url":"https://avatars.githubusercontent.com/u/1089309?v=3","gravatar_id":"","url":"https://api.github.com/users/fritsch","html_url":"https://github.com/fritsch","followers_url":"https://api.github.com/users/fritsch/followers","following_url":"https://api.github.com/users/fritsch/following{/other_user}","gists_url":"https://api.github.com/users/fritsch/gists{/gist_id}","starred_url":"https://api.github.com/users/fritsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritsch/subscriptions","organizations_url":"https://api.github.com/users/fritsch/orgs","repos_url":"https://api.github.com/users/fritsch/repos","events_url":"https://api.github.com/users/fritsch/events{/privacy}","received_events_url":"https://api.github.com/users/fritsch/received_events","type":"User","site_admin":false},"body":"v2: Unify logging\r\nv3: incorporate width difference into decision\r\n\r\nThis implements a long requested feature. Consider the use case, that you are using a HDMI 1.4b hdmi out to a 4k@30p TV. As additinionally our GUI upscaling method is of low quality and as you want to watch content > 30 hz, you are running your TV at 1080p50/60.\r\n\r\nNow the requested feature was:\r\n- Switch to a 4k mode if content is 4k and in the supported refreshrate range that is supported by the TV.\r\n\r\nThat is what this PR does. Additionally it takes care that 3840x2160 content is displayed at 3840x2160 content and larger content is displayed at 4096x1744 if available.\r\n\r\nContent that cannot be display without sever frame skipping, e.g. 3840x2160@60p will be rendered at the max resolution supporting this refreshrate, e.g. 1080p60.\r\n\r\nThis was tested by forum user fab67. Discussion was done with @FernetMenta in advance. Algorithm and code was shown and discussed @paxxi on IRC.","created_at":"2015-09-12T19:28:54Z","updated_at":"2015-09-17T07:16:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d924d0d2e0966d4b716faf0dedd75b749ea2b191","assignee":null,"milestone":{"url":"https://api.github.com/repos/xbmc/xbmc/milestones/69","html_url":"https://github.com/xbmc/xbmc/milestones/Jarvis%2016.0-alpha3","labels_url":"https://api.github.com/repos/xbmc/xbmc/milestones/69/labels","id":1265879,"number":69,"title":"Jarvis 16.0-alpha3","description":"","creator":{"login":"MartijnKaijser","id":907436,"avatar_url":"https://avatars.githubusercontent.com/u/907436?v=3","gravatar_id":"","url":"https://api.github.com/users/MartijnKaijser","html_url":"https://github.com/MartijnKaijser","followers_url":"https://api.github.com/users/MartijnKaijser/followers","following_url":"https://api.github.com/users/MartijnKaijser/following{/other_user}","gists_url":"https://api.github.com/users/MartijnKaijser/gists{/gist_id}","starred_url":"https://api.github.com/users/MartijnKaijser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartijnKaijser/subscriptions","organizations_url":"https://api.github.com/users/MartijnKaijser/orgs","repos_url":"https://api.github.com/users/MartijnKaijser/repos","events_url":"https://api.github.com/users/MartijnKaijser/events{/privacy}","received_events_url":"https://api.github.com/users/MartijnKaijser/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":131,"state":"open","created_at":"2015-08-21T07:00:45Z","updated_at":"2015-09-17T07:02:18Z","due_on":"2015-09-29T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/xbmc/xbmc/pulls/8031/commits","review_comments_url":"https://api.github.com/repos/xbmc/xbmc/pulls/8031/comments","review_comment_url":"https://api.github.com/repos/xbmc/xbmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/8031/comments","statuses_url":"https://api.github.com/repos/xbmc/xbmc/statuses/36791fcc28cd7fede060ca6edee69ae22c027230","head":{"label":"fritsch:adjustrefreshupstream","ref":"adjustrefreshupstream","sha":"36791fcc28cd7fede060ca6edee69ae22c027230","user":{"login":"fritsch","id":1089309,"avatar_url":"https://avatars.githubusercontent.com/u/1089309?v=3","gravatar_id":"","url":"https://api.github.com/users/fritsch","html_url":"https://github.com/fritsch","followers_url":"https://api.github.com/users/fritsch/followers","following_url":"https://api.github.com/users/fritsch/following{/other_user}","gists_url":"https://api.github.com/users/fritsch/gists{/gist_id}","starred_url":"https://api.github.com/users/fritsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritsch/subscriptions","organizations_url":"https://api.github.com/users/fritsch/orgs","repos_url":"https://api.github.com/users/fritsch/repos","events_url":"https://api.github.com/users/fritsch/events{/privacy}","received_events_url":"https://api.github.com/users/fritsch/received_events","type":"User","site_admin":false},"repo":{"id":2808359,"name":"xbmc","full_name":"fritsch/xbmc","owner":{"login":"fritsch","id":1089309,"avatar_url":"https://avatars.githubusercontent.com/u/1089309?v=3","gravatar_id":"","url":"https://api.github.com/users/fritsch","html_url":"https://github.com/fritsch","followers_url":"https://api.github.com/users/fritsch/followers","following_url":"https://api.github.com/users/fritsch/following{/other_user}","gists_url":"https://api.github.com/users/fritsch/gists{/gist_id}","starred_url":"https://api.github.com/users/fritsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritsch/subscriptions","organizations_url":"https://api.github.com/users/fritsch/orgs","repos_url":"https://api.github.com/users/fritsch/repos","events_url":"https://api.github.com/users/fritsch/events{/privacy}","received_events_url":"https://api.github.com/users/fritsch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fritsch/xbmc","description":"Fork of  XBMC Main PVR Development Repository.","fork":true,"url":"https://api.github.com/repos/fritsch/xbmc","forks_url":"https://api.github.com/repos/fritsch/xbmc/forks","keys_url":"https://api.github.com/repos/fritsch/xbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fritsch/xbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fritsch/xbmc/teams","hooks_url":"https://api.github.com/repos/fritsch/xbmc/hooks","issue_events_url":"https://api.github.com/repos/fritsch/xbmc/issues/events{/number}","events_url":"https://api.github.com/repos/fritsch/xbmc/events","assignees_url":"https://api.github.com/repos/fritsch/xbmc/assignees{/user}","branches_url":"https://api.github.com/repos/fritsch/xbmc/branches{/branch}","tags_url":"https://api.github.com/repos/fritsch/xbmc/tags","blobs_url":"https://api.github.com/repos/fritsch/xbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fritsch/xbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fritsch/xbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/fritsch/xbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fritsch/xbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/fritsch/xbmc/languages","stargazers_url":"https://api.github.com/repos/fritsch/xbmc/stargazers","contributors_url":"https://api.github.com/repos/fritsch/xbmc/contributors","subscribers_url":"https://api.github.com/repos/fritsch/xbmc/subscribers","subscription_url":"https://api.github.com/repos/fritsch/xbmc/subscription","commits_url":"https://api.github.com/repos/fritsch/xbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/fritsch/xbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/fritsch/xbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/fritsch/xbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/fritsch/xbmc/contents/{+path}","compare_url":"https://api.github.com/repos/fritsch/xbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fritsch/xbmc/merges","archive_url":"https://api.github.com/repos/fritsch/xbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fritsch/xbmc/downloads","issues_url":"https://api.github.com/repos/fritsch/xbmc/issues{/number}","pulls_url":"https://api.github.com/repos/fritsch/xbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/fritsch/xbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/fritsch/xbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fritsch/xbmc/labels{/name}","releases_url":"https://api.github.com/repos/fritsch/xbmc/releases{/id}","created_at":"2011-11-19T11:16:56Z","updated_at":"2015-09-10T12:51:09Z","pushed_at":"2015-09-17T06:33:39Z","git_url":"git://github.com/fritsch/xbmc.git","ssh_url":"git@github.com:fritsch/xbmc.git","clone_url":"https://github.com/fritsch/xbmc.git","svn_url":"https://github.com/fritsch/xbmc","homepage":"http://xbmc.org","size":548037,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"xbmc:master","ref":"master","sha":"b9d1772d274ac766f920aa822457a6a3be373f92","user":{"login":"xbmc","id":199122,"avatar_url":"https://avatars.githubusercontent.com/u/199122?v=3","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"repo":{"id":1217614,"name":"xbmc","full_name":"xbmc/xbmc","owner":{"login":"xbmc","id":199122,"avatar_url":"https://avatars.githubusercontent.com/u/199122?v=3","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xbmc/xbmc","description":"Kodi Main Repository - By using this code you agree with our policy and will follow the GPLv2 license as included","fork":false,"url":"https://api.github.com/repos/xbmc/xbmc","forks_url":"https://api.github.com/repos/xbmc/xbmc/forks","keys_url":"https://api.github.com/repos/xbmc/xbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xbmc/xbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xbmc/xbmc/teams","hooks_url":"https://api.github.com/repos/xbmc/xbmc/hooks","issue_events_url":"https://api.github.com/repos/xbmc/xbmc/issues/events{/number}","events_url":"https://api.github.com/repos/xbmc/xbmc/events","assignees_url":"https://api.github.com/repos/xbmc/xbmc/assignees{/user}","branches_url":"https://api.github.com/repos/xbmc/xbmc/branches{/branch}","tags_url":"https://api.github.com/repos/xbmc/xbmc/tags","blobs_url":"https://api.github.com/repos/xbmc/xbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xbmc/xbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xbmc/xbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/xbmc/xbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xbmc/xbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/xbmc/xbmc/languages","stargazers_url":"https://api.github.com/repos/xbmc/xbmc/stargazers","contributors_url":"https://api.github.com/repos/xbmc/xbmc/contributors","subscribers_url":"https://api.github.com/repos/xbmc/xbmc/subscribers","subscription_url":"https://api.github.com/repos/xbmc/xbmc/subscription","commits_url":"https://api.github.com/repos/xbmc/xbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/xbmc/xbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/xbmc/xbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/xbmc/xbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/xbmc/xbmc/contents/{+path}","compare_url":"https://api.github.com/repos/xbmc/xbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xbmc/xbmc/merges","archive_url":"https://api.github.com/repos/xbmc/xbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xbmc/xbmc/downloads","issues_url":"https://api.github.com/repos/xbmc/xbmc/issues{/number}","pulls_url":"https://api.github.com/repos/xbmc/xbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/xbmc/xbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/xbmc/xbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xbmc/xbmc/labels{/name}","releases_url":"https://api.github.com/repos/xbmc/xbmc/releases{/id}","created_at":"2011-01-03T21:18:51Z","updated_at":"2015-09-16T02:45:20Z","pushed_at":"2015-09-17T07:02:20Z","git_url":"git://github.com/xbmc/xbmc.git","ssh_url":"git@github.com:xbmc/xbmc.git","clone_url":"https://github.com/xbmc/xbmc.git","svn_url":"https://github.com/xbmc/xbmc","homepage":"http://kodi.wiki/view/Official:Trademark_Policy","size":1892757,"stargazers_count":4102,"watchers_count":4102,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3020,"mirror_url":null,"open_issues_count":206,"forks":3020,"open_issues":206,"watchers":4102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8031"},"html":{"href":"https://github.com/xbmc/xbmc/pull/8031"},"issue":{"href":"https://api.github.com/repos/xbmc/xbmc/issues/8031"},"comments":{"href":"https://api.github.com/repos/xbmc/xbmc/issues/8031/comments"},"review_comments":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8031/comments"},"review_comment":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8031/commits"},"statuses":{"href":"https://api.github.com/repos/xbmc/xbmc/statuses/36791fcc28cd7fede060ca6edee69ae22c027230"}}}}