GitHub PullRequestReviewCommentEvent at 2014-02-09 18:02:45
Repository: xbmc
Actor: t-nelson
Payload: {"comment":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/9569805","id":9569805,"diff_hunk":"@@ -520,22 +518,35 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int\n \n   {\n     VdpDecoderProfile profile = 0;\n-    if(avctx->codec_id == AV_CODEC_ID_H264)\n-      profile = VDP_DECODER_PROFILE_H264_HIGH;\n-#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_ASP\n-    else if(avctx->codec_id == AV_CODEC_ID_MPEG4)\n-      profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;\n-#endif\n+    /* Change FFMPEG Codec ID to VDPAU Profile. */\n+\tReadFormatOf(avctx->codec_id, profile, m_vdpauConfig.vdpChromaType);\n     if(profile)\n     {\n+      VdpStatus vdp_st;\n+      VdpBool is_supported = false;\n+      uint32_t max_level, max_macroblocks, max_width, max_height;\n+      /* Query Device Capabilities to Ensure that VDPAU Can handle the Requested Codec */\n+      vdp_st = m_vdpauConfig.context->GetProcs().vdp_decoder_query_caps(m_vdpauConfig.context->GetDevice(),\n+       profile, &is_supported, &max_level, &max_macroblocks, &max_width, &max_height);\n+      /* Test to make Sure there is a Possibility the Codec will Work */\n+      if(CheckStatus(vdp_st, __LINE__))\n+      {\n+        CLog::Log(LOGERROR, \" (VDPAU) Error: %s(%d) checking for decoder support\\n\", m_vdpauConfig.context->GetProcs().vdp_get_error_string(vdp_st), vdp_st);\n+        return false;\n+      }\n+      if(max_width < avctx->coded_width || max_height < avctx->coded_height)\n+      {\n+        CLog::Log(LOGWARNING,\"(VDPAU) Requested Picture Dimensions (%i, %i) exceed hardware capabilities ( %i, %i).\", \n+\t        avctx->coded_width, avctx->coded_height, max_width, max_height);\n+        return false;\n+      }\n       if (!CDVDCodecUtils::IsVP3CompatibleWidth(avctx->coded_width))\n         CLog::Log(LOGWARNING,\"(VDPAU) width %i might not be supported because of hardware bug\", avctx->width);\n    \n       /* attempt to create a decoder with this width/height, some sizes are not supported by hw */\n-      VdpStatus vdp_st;\n       vdp_st = m_vdpauConfig.context->GetProcs().vdp_decoder_create(m_vdpauConfig.context->GetDevice(), profile, avctx->coded_width, avctx->coded_height, 5, &m_vdpauConfig.vdpDecoder);\n \n-      if(vdp_st != VDP_STATUS_OK)\n+      if(CheckStatus(vdp_st, __LINE__))","path":"xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp","position":50,"original_position":50,"commit_id":"b8f01be29e7d19ea42be0540044273ea7c7b02fb","original_commit_id":"b8f01be29e7d19ea42be0540044273ea7c7b02fb","user":{"login":"t-nelson","id":490004,"avatar_url":"https://gravatar.com/avatar/53956b3bf69430d4a06fb1aacf9e2460?d=https%3A%2F%2Fidenticons.github.com%2F2e945d945bd11c01d5f60310b4d0df39.png&r=x","gravatar_id":"53956b3bf69430d4a06fb1aacf9e2460","url":"https://api.github.com/users/t-nelson","html_url":"https://github.com/t-nelson","followers_url":"https://api.github.com/users/t-nelson/followers","following_url":"https://api.github.com/users/t-nelson/following{/other_user}","gists_url":"https://api.github.com/users/t-nelson/gists{/gist_id}","starred_url":"https://api.github.com/users/t-nelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-nelson/subscriptions","organizations_url":"https://api.github.com/users/t-nelson/orgs","repos_url":"https://api.github.com/users/t-nelson/repos","events_url":"https://api.github.com/users/t-nelson/events{/privacy}","received_events_url":"https://api.github.com/users/t-nelson/received_events","type":"User","site_admin":false},"body":"May as well fix the missing space between if and ( while you're here.","created_at":"2014-02-09T18:02:45Z","updated_at":"2014-02-09T18:02:45Z","html_url":"https://github.com/xbmc/xbmc/pull/4162#discussion_r9569805","pull_request_url":"https://api.github.com/repos/xbmc/xbmc/pulls/4162","_links":{"self":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/9569805"},"html":{"href":"https://github.com/xbmc/xbmc/pull/4162#discussion_r9569805"},"pull_request":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/4162"}}}}