From fe0edc0bdac719fa7caac2260d2083ec9e7aabbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 16 Mar 2025 12:36:53 +0100 Subject: [PATCH] One more cleanup before merging Analyze and SetData... --- Core/HLE/AtracCtx.cpp | 4 ++++ Core/HLE/sceAtrac.cpp | 21 ++++----------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Core/HLE/AtracCtx.cpp b/Core/HLE/AtracCtx.cpp index d13434638c..e59afb9b06 100644 --- a/Core/HLE/AtracCtx.cpp +++ b/Core/HLE/AtracCtx.cpp @@ -757,6 +757,10 @@ int Atrac::SetData(u32 buffer, u32 readSize, u32 bufferSize, int outputChannels) CreateDecoder(); INFO_LOG(Log::ME, "Atrac::SetData (buffer=%08x, readSize=%d, bufferSize=%d): %s %s (%d channels) audio", buffer, readSize, bufferSize, codecName, channelName, track_.channels); + if (track_.channels == 2 && outputChannels == 1) { + // We still do all the tasks, we just return this error. + return SCE_ERROR_ATRAC_NOT_MONO; + } return 0; } diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index b0686892bd..11da51f2c1 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -702,7 +702,6 @@ static u32 sceAtracSetLoopNum(int atracID, int loopNum) { if (err != 0) { return hleLogError(Log::ME, err); } - int ret = atrac->SetLoopNum(loopNum); if (ret == SCE_ERROR_ATRAC_NO_LOOP_INFORMATION && loopNum == -1) { // Not really an issue @@ -800,14 +799,8 @@ static int sceAtracSetMOutHalfwayBuffer(int atracID, u32 buffer, u32 readSize, u if (ret < 0) { return hleLogError(Log::ME, ret); } - if (atrac->Channels() != 1) { - // It seems it still sets the data. - atrac->SetData(buffer, readSize, bufferSize, 2); - return hleReportError(Log::ME, SCE_ERROR_ATRAC_NOT_MONO, "not mono data"); - } else { - ret = atrac->SetData(buffer, readSize, bufferSize, 1); - return hleDelayResult(hleLogDebugOrError(Log::ME, ret), "atrac set data mono", 100); - } + ret = atrac->SetData(buffer, readSize, bufferSize, 1); + return hleDelayResult(hleLogDebugOrError(Log::ME, ret), "atrac set data mono", 100); } // Note: This doesn't seem to be part of any available libatrac3plus library. @@ -830,14 +823,8 @@ static u32 sceAtracSetMOutData(int atracID, u32 buffer, u32 bufferSize) { if (ret < 0) { return hleLogError(Log::ME, ret); } - if (atrac->Channels() != 1) { - // It seems it still sets the data. - atrac->SetData(buffer, bufferSize, bufferSize, 2); - return hleReportError(Log::ME, SCE_ERROR_ATRAC_NOT_MONO, "not mono data"); - } else { - ret = atrac->SetData(buffer, bufferSize, bufferSize, 1); - return hleDelayResult(hleLogDebugOrError(Log::ME, ret), "atrac set data mono", 100); - } + ret = atrac->SetData(buffer, bufferSize, bufferSize, 1); + return hleDelayResult(hleLogDebugOrError(Log::ME, ret), "atrac set data mono", 100); } // Note: This doesn't seem to be part of any available libatrac3plus library.