Improve aac decoder selection

This commit is contained in:
James Rowe
2019-12-08 14:19:19 -07:00
parent b395efe804
commit 337ac73915
6 changed files with 52 additions and 6 deletions

View File

@ -87,15 +87,27 @@ DspHle::Impl::Impl(DspHle& parent_, Memory::MemorySystem& memory) : parent(paren
source.SetMemory(memory);
}
#ifdef HAVE_MF
#if defined(HAVE_MF) && defined(HAVE_FFMPEG)
decoder = std::make_unique<HLE::WMFDecoder>(memory);
#elif HAVE_FFMPEG
if (!decoder->IsValid()) {
LOG_WARNING(Audio_DSP, "Unable to load MediaFoundation. Attempting to load FFMPEG instead");
decoder = std::make_unique<HLE::FFMPEGDecoder>(memory);
}
#elif defined(HAVE_MF)
decoder = std::make_unique<HLE::WMFDecoder>(memory);
#elif defined(HAVE_FFMPEG)
decoder = std::make_unique<HLE::FFMPEGDecoder>(memory);
#else
LOG_WARNING(Audio_DSP, "No decoder found, this could lead to missing audio");
decoder = std::make_unique<HLE::NullDecoder>();
#endif // HAVE_MF
if (!decoder->IsValid()) {
LOG_WARNING(Audio_DSP,
"Unable to load any decoders, this could cause missing audio in some games");
decoder = std::make_unique<HLE::NullDecoder>();
}
Core::Timing& timing = Core::System::GetInstance().CoreTiming();
tick_event =
timing.RegisterEvent("AudioCore::DspHle::tick_event", [this](u64, s64 cycles_late) {