Fixup audio device name writing in services

Games expect the output buffer the be entirely zero filled past the device name.
This commit is contained in:
Billy Laws 2022-04-30 15:33:44 +01:00
parent 194cbe6c7c
commit ae77bde171

View File

@ -9,6 +9,7 @@ namespace skyline::service::audio {
IAudioOutManager::IAudioOutManager(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {}
Result IAudioOutManager::ListAudioOuts(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
std::memset(request.outputBuf.at(0).data(), 0, request.outputBuf.at(0).size());
request.outputBuf.at(0).copy_from(constant::DefaultAudioOutName);
return {};
}
@ -30,6 +31,8 @@ namespace skyline::service::audio {
response.Push(static_cast<u32>(skyline::audio::AudioFormat::Int16));
response.Push(static_cast<u32>(skyline::audio::AudioOutState::Stopped));
std::memset(request.outputBuf.at(0).data(), 0, request.outputBuf.at(0).size());
if (request.inputBuf.at(0).empty() || !request.inputBuf.at(0)[0])
request.outputBuf.at(0).copy_from(constant::DefaultAudioOutName);
else