mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-24 14:24:54 +00:00
IOS/USB: Lock microphone buffer less frequently
This commit is contained in:
parent
82a03ca73b
commit
f7eadc1f11
3 changed files with 4 additions and 4 deletions
|
@ -188,9 +188,9 @@ u16 Microphone::ReadIntoBuffer(u8* ptr, u32 size)
|
|||
return static_cast<u16>(ptr - begin);
|
||||
}
|
||||
|
||||
bool Microphone::HasData() const
|
||||
bool Microphone::HasData(u32 sample_count = BUFF_SIZE_SAMPLES) const
|
||||
{
|
||||
return m_samples_avail > 0;
|
||||
return m_samples_avail >= sample_count;
|
||||
}
|
||||
|
||||
const WiiSpeakState& Microphone::GetSampler() const
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
Microphone(const WiiSpeakState& sampler);
|
||||
~Microphone();
|
||||
|
||||
bool HasData() const;
|
||||
bool HasData(u32 sample_count) const;
|
||||
u16 ReadIntoBuffer(u8* ptr, u32 size);
|
||||
const WiiSpeakState& GetSampler() const;
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ int WiiSpeak::SubmitTransfer(std::unique_ptr<IsoMessage> cmd)
|
|||
{
|
||||
// Transfer: Wii Speak -> Wii
|
||||
u16 size = 0;
|
||||
if (m_microphone && m_microphone->HasData())
|
||||
if (m_microphone && m_microphone->HasData(cmd->length / sizeof(s16)))
|
||||
size = m_microphone->ReadIntoBuffer(packets, cmd->length);
|
||||
for (std::size_t i = 0; i < cmd->num_packets; i++)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue