string->cstring and made WorkerBufferSize a static local function
This commit is contained in:
@@ -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"},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user