mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
cellAudio: recover Cubeb on failed initialization
This commit is contained in:
parent
68466f05b6
commit
3f3b4bc363
@ -97,6 +97,12 @@ void CubebBackend::Open(AudioFreq freq, AudioSampleSize sample_size, AudioChanne
|
|||||||
{
|
{
|
||||||
m_stream = nullptr;
|
m_stream = nullptr;
|
||||||
Cubeb.error("cubeb_stream_init() failed: 0x%08x", err);
|
Cubeb.error("cubeb_stream_init() failed: 0x%08x", err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_stream == nullptr)
|
||||||
|
{
|
||||||
|
Cubeb.error("Failed to open audio backend. Make sure that no other application is running that might block audio access (e.g. Netflix).");
|
||||||
|
CloseUnlocked();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +136,6 @@ void CubebBackend::Close()
|
|||||||
|
|
||||||
void CubebBackend::Play()
|
void CubebBackend::Play()
|
||||||
{
|
{
|
||||||
ensure(m_stream != nullptr);
|
|
||||||
|
|
||||||
if (m_playing) return;
|
if (m_playing) return;
|
||||||
|
|
||||||
if (int err = cubeb_stream_start(m_stream))
|
if (int err = cubeb_stream_start(m_stream))
|
||||||
@ -145,8 +149,6 @@ void CubebBackend::Play()
|
|||||||
|
|
||||||
void CubebBackend::Pause()
|
void CubebBackend::Pause()
|
||||||
{
|
{
|
||||||
ensure(m_stream != nullptr);
|
|
||||||
|
|
||||||
if (int err = cubeb_stream_stop(m_stream))
|
if (int err = cubeb_stream_stop(m_stream))
|
||||||
{
|
{
|
||||||
Cubeb.error("cubeb_stream_stop() failed: 0x%08x", err);
|
Cubeb.error("cubeb_stream_stop() failed: 0x%08x", err);
|
||||||
@ -158,8 +160,6 @@ void CubebBackend::Pause()
|
|||||||
|
|
||||||
bool CubebBackend::IsPlaying()
|
bool CubebBackend::IsPlaying()
|
||||||
{
|
{
|
||||||
ensure(m_stream != nullptr);
|
|
||||||
|
|
||||||
return m_playing;
|
return m_playing;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,8 +171,6 @@ void CubebBackend::SetWriteCallback(std::function<u32(u32, void *)> cb)
|
|||||||
|
|
||||||
f64 CubebBackend::GetCallbackFrameLen()
|
f64 CubebBackend::GetCallbackFrameLen()
|
||||||
{
|
{
|
||||||
ensure(m_stream != nullptr);
|
|
||||||
|
|
||||||
cubeb_stream_params stream_param{};
|
cubeb_stream_params stream_param{};
|
||||||
stream_param.format = get_convert_to_s16() ? CUBEB_SAMPLE_S16NE : CUBEB_SAMPLE_FLOAT32NE;
|
stream_param.format = get_convert_to_s16() ? CUBEB_SAMPLE_S16NE : CUBEB_SAMPLE_FLOAT32NE;
|
||||||
stream_param.rate = get_sampling_rate();
|
stream_param.rate = get_sampling_rate();
|
||||||
|
@ -117,7 +117,7 @@ EmuCallbacks main_application::CreateCallbacks()
|
|||||||
if (!result->Initialized())
|
if (!result->Initialized())
|
||||||
{
|
{
|
||||||
// Fall back to a null backend if something went wrong
|
// Fall back to a null backend if something went wrong
|
||||||
sys_log.error("Audio renderer %s could not be initialized, using a Null renderer instead", result->GetName());
|
sys_log.error("Audio renderer %s could not be initialized, using a Null renderer instead. Make sure that no other application is running that might block audio access (e.g. Netflix).", result->GetName());
|
||||||
result = std::make_shared<NullAudioBackend>();
|
result = std::make_shared<NullAudioBackend>();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user