mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-05 15:40:10 +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;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -130,8 +136,6 @@ void CubebBackend::Close()
|
||||
|
||||
void CubebBackend::Play()
|
||||
{
|
||||
ensure(m_stream != nullptr);
|
||||
|
||||
if (m_playing) return;
|
||||
|
||||
if (int err = cubeb_stream_start(m_stream))
|
||||
@ -145,8 +149,6 @@ void CubebBackend::Play()
|
||||
|
||||
void CubebBackend::Pause()
|
||||
{
|
||||
ensure(m_stream != nullptr);
|
||||
|
||||
if (int err = cubeb_stream_stop(m_stream))
|
||||
{
|
||||
Cubeb.error("cubeb_stream_stop() failed: 0x%08x", err);
|
||||
@ -158,8 +160,6 @@ void CubebBackend::Pause()
|
||||
|
||||
bool CubebBackend::IsPlaying()
|
||||
{
|
||||
ensure(m_stream != nullptr);
|
||||
|
||||
return m_playing;
|
||||
}
|
||||
|
||||
@ -171,8 +171,6 @@ void CubebBackend::SetWriteCallback(std::function<u32(u32, void *)> cb)
|
||||
|
||||
f64 CubebBackend::GetCallbackFrameLen()
|
||||
{
|
||||
ensure(m_stream != nullptr);
|
||||
|
||||
cubeb_stream_params stream_param{};
|
||||
stream_param.format = get_convert_to_s16() ? CUBEB_SAMPLE_S16NE : CUBEB_SAMPLE_FLOAT32NE;
|
||||
stream_param.rate = get_sampling_rate();
|
||||
|
@ -35,8 +35,8 @@ public:
|
||||
bool IsPlaying() override;
|
||||
|
||||
private:
|
||||
cubeb *m_ctx = nullptr;
|
||||
cubeb_stream *m_stream = nullptr;
|
||||
cubeb* m_ctx = nullptr;
|
||||
cubeb_stream* m_stream = nullptr;
|
||||
#ifdef _WIN32
|
||||
bool m_com_init_success = false;
|
||||
#endif
|
||||
|
@ -117,7 +117,7 @@ EmuCallbacks main_application::CreateCallbacks()
|
||||
if (!result->Initialized())
|
||||
{
|
||||
// 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>();
|
||||
}
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user