string->cstring and made WorkerBufferSize a static local function

This commit is contained in:
David Marcec
2018-07-29 10:33:56 +10:00
parent d2e361533c
commit fd53a7b0a1
2 changed files with 6 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <string>
#include <cstring>
#include <opus.h>
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
@@ -90,6 +90,11 @@ private:
u32 channel_count;
};
static size_t WorkerBufferSize(u32 channel_count) {
ASSERT_MSG(channel_count == 1 || channel_count == 2, "Invalid channel count");
return opus_decoder_get_size(static_cast<int>(channel_count));
}
void HwOpus::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
auto sample_rate = rp.Pop<u32>();
@@ -135,11 +140,6 @@ void HwOpus::OpenOpusDecoder(Kernel::HLERequestContext& ctx) {
channel_count);
}
size_t HwOpus::WorkerBufferSize(u32 channel_count) {
ASSERT_MSG(channel_count == 1 || channel_count == 2, "Invalid channel count");
return opus_decoder_get_size(static_cast<int>(channel_count));
}
HwOpus::HwOpus() : ServiceFramework("hwopus") {
static const FunctionInfo functions[] = {
{0, &HwOpus::OpenOpusDecoder, "OpenOpusDecoder"},

View File

@@ -16,7 +16,6 @@ public:
private:
void OpenOpusDecoder(Kernel::HLERequestContext& ctx);
void GetWorkBufferSize(Kernel::HLERequestContext& ctx);
size_t WorkerBufferSize(u32 channel_count);
};
} // namespace Service::Audio