From 793e7f070633e621b704fcdd930ae01442081b7a Mon Sep 17 00:00:00 2001 From: ananta Date: Wed, 25 Mar 2015 17:27:22 -0700 Subject: [PATCH] Ensure that the DXVA decoder for VP8 and VP9 picks up the path for the HMFT correctly on non WOW64 environments The DXVA decoder incorrectly assumes that the ProgramW6432 environment variable exists on vanilla 32 bit Windows OS'es which is not the case. This causes the HMFT load to fail. Fix is to only use the DIR_PROGRAM_FILES6432 directory type for a WOW64 environment which is 32 bit chrome on a 64 bit OS. In the normal case we use the vanilla DIR_PROGRAM_FILES type. BUG=470193 Review URL: https://codereview.chromium.org/1031263002 Cr-Commit-Position: refs/heads/master@{#322272} --- content/common/gpu/media/dxva_video_decode_accelerator.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc index 25aae5c56163..801ff578f5ec 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator.cc +++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc @@ -940,9 +940,16 @@ bool DXVAVideoDecodeAccelerator::InitDecoder(media::VideoCodecProfile profile) { codec_ = media::kCodecH264; } else if (profile == media::VP8PROFILE_ANY || profile == media::VP9PROFILE_ANY) { + int program_files_key = base::DIR_PROGRAM_FILES; + if (base::win::OSInfo::GetInstance()->wow64_status() == + base::win::OSInfo::WOW64_ENABLED) { + program_files_key = base::DIR_PROGRAM_FILES6432; + } + base::FilePath dll_path; - RETURN_ON_FAILURE(PathService::Get(base::DIR_PROGRAM_FILES6432, &dll_path), - "failed to get path for DIR_PROGRAM_FILES6432", false); + RETURN_ON_FAILURE(PathService::Get(program_files_key, &dll_path), + "failed to get path for Program Files", false); + dll_path = dll_path.Append(kVPXDecoderDLLPath); if (profile == media::VP8PROFILE_ANY) { codec_ = media::kCodecVP8; -- 2.11.4.GIT