CubebAudioStream: Fix crash in PulseAudio on Linux

This commit is contained in:
Connor McLaughlin
2020-06-09 03:03:53 +10:00
parent d7f083559e
commit 86f0d32e70
2 changed files with 1 additions and 18 deletions

View File

@ -118,14 +118,7 @@ long CubebAudioStream::DataCallback(cubeb_stream* stm, void* user_ptr, const voi
long nframes)
{
CubebAudioStream* const this_ptr = static_cast<CubebAudioStream*>(user_ptr);
if (this_ptr->m_output_volume_changed.load())
{
this_ptr->m_output_volume_changed.store(false);
cubeb_stream_set_volume(this_ptr->m_cubeb_stream, static_cast<float>(this_ptr->m_output_volume) / 100.0f);
}
this_ptr->ReadFrames(reinterpret_cast<SampleType*>(output_buffer), static_cast<u32>(nframes), false);
this_ptr->ReadFrames(reinterpret_cast<SampleType*>(output_buffer), static_cast<u32>(nframes), true);
return nframes;
}
@ -149,12 +142,6 @@ void CubebAudioStream::DestroyContext()
#endif
}
void CubebAudioStream::SetOutputVolume(u32 volume)
{
AudioStream::SetOutputVolume(volume);
m_output_volume_changed.store(true);
}
std::unique_ptr<AudioStream> AudioStream::CreateCubebAudioStream()
{
return std::make_unique<CubebAudioStream>();