mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	more reviews addressed
This commit is contained in:
		
							parent
							
								
									8fe3e37df5
								
							
						
					
					
						commit
						1581dea6de
					
				
					 3 changed files with 10 additions and 8 deletions
				
			
		|  | @ -20,7 +20,6 @@ std::optional<BinaryResponse> NullDecoder::ProcessRequest(const BinaryRequest& r | |||
|         std::memcpy(&response, &request, sizeof(response)); | ||||
|         response.unknown1 = 0x0; | ||||
|         return response; | ||||
|         break; | ||||
|     case DecoderCommand::Decode: | ||||
|         response.codec = request.codec; | ||||
|         response.cmd = DecoderCommand::Decode; | ||||
|  | @ -28,11 +27,9 @@ std::optional<BinaryResponse> NullDecoder::ProcessRequest(const BinaryRequest& r | |||
|         response.size = request.size; | ||||
|         response.num_samples = 1024; // Just assume 1024 here
 | ||||
|         return response; | ||||
|         break; | ||||
|     default: | ||||
|         LOG_ERROR(Audio_DSP, "Got unknown binary request: {}", static_cast<u16>(request.cmd)); | ||||
|         return {}; | ||||
|         break; | ||||
|     } | ||||
| }; | ||||
| } // namespace AudioCore::HLE
 | ||||
|  |  | |||
|  | @ -8,10 +8,13 @@ | |||
| #include "audio_core/hle/ffmpeg_dl.h" | ||||
| #include "common/file_util.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "common/string_util.h" | ||||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| struct LibraryDeleter { | ||||
|     typedef HMODULE pointer; | ||||
|     void operator()(HMODULE h) { | ||||
|     using pointer = HMODULE; | ||||
|     void operator()(HMODULE h) const { | ||||
|         if (h != nullptr) | ||||
|             FreeLibrary(h); | ||||
|     } | ||||
|  | @ -20,6 +23,8 @@ struct LibraryDeleter { | |||
| std::unique_ptr<HMODULE, LibraryDeleter> dll_util{nullptr}; | ||||
| std::unique_ptr<HMODULE, LibraryDeleter> dll_codec{nullptr}; | ||||
| 
 | ||||
| } // namespace
 | ||||
| 
 | ||||
| FuncDL<int(AVSampleFormat)> av_get_bytes_per_sample_dl; | ||||
| FuncDL<AVFrame*(void)> av_frame_alloc_dl; | ||||
| FuncDL<void(AVFrame**)> av_frame_free_dl; | ||||
|  | @ -40,7 +45,7 @@ FuncDL<void(AVCodecParserContext*)> av_parser_close_dl; | |||
| bool InitFFmpegDL() { | ||||
|     std::string dll_path = FileUtil::GetUserPath(FileUtil::UserPath::DLLDir); | ||||
|     FileUtil::CreateDir(dll_path); | ||||
|     std::wstring w_dll_path = std::wstring(dll_path.begin(), dll_path.end()); | ||||
|     std::wstring w_dll_path = Common::UTF8ToUTF16W(dll_path); | ||||
|     SetDllDirectoryW(w_dll_path.c_str()); | ||||
| 
 | ||||
|     dll_util.reset(LoadLibrary("avutil-56.dll")); | ||||
|  |  | |||
|  | @ -17,9 +17,9 @@ extern "C" { | |||
| template <typename T> | ||||
| struct FuncDL { | ||||
|     FuncDL() = default; | ||||
|     FuncDL(void* dll, const char* name) { | ||||
|     FuncDL(HMODULE dll, const char* name) { | ||||
|         if (dll) { | ||||
|             ptr_function = reinterpret_cast<T*>(GetProcAddress((HMODULE)dll, name)); | ||||
|             ptr_function = reinterpret_cast<T*>(GetProcAddress(dll, name)); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue