Page MenuHomeWildfire Games

Fix crash at start in snd_detect()
ClosedPublic

Authored by Itms on Jan 24 2018, 10:58 PM.

Details

Summary

Fix a stupid oversight in rP19877, tracked down by @s0600204.

Test Plan

Check #4786 is fixed.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Itms created this revision.Jan 24 2018, 10:58 PM
echotangoecho accepted this revision.Jan 25 2018, 1:49 PM
echotangoecho added a subscriber: echotangoecho.

Looks good to me (can't check if issue is fixed as I don't have the issue, but the return value should be checked in any case).

This revision is now accepted and ready to land.Jan 25 2018, 1:49 PM
Stan added a subscriber: Stan.EditedJan 25 2018, 3:55 PM

If someone wants to reproduce the crash easily on windows, just disable every sound card in the sound panel.

Interestingly enough, atlas will display an error message, while the game will just crash.

Atlas message

ERROR: Sound: AlcInit failed, m_Device=0x0 m_Context=0x0 dev_name=OpenAL Soft err=a004
Stan added a comment.EditedJan 25 2018, 4:04 PM

Just tested the patch, and can confirm it crashes without and it doesn't with it.

When testing it with no sound card, I get a slightly different message :

ERROR: Sound: AlcInit failed, m_Device=0x0 m_Context=0x0 dev_name=OpenAL Soft err=a004
ERROR: OpenAL error: (null); called from CSoundManager::~CSoundManager (line 277)

While atlas says (pyrogenesis.exe -editor)

ERROR: Sound: AlcInit failed, m_Device=0x0 m_Context=0x0 dev_name=OpenAL Soft err=a004

I guess it's because it's not playing sound in atlas.

When clicking on a building in the game I get this

ERROR: OpenAL error: (null); called from COggData::InitOggFile (line 74)

ERROR: Failed to create initial buffer. OpenAL error: (null)

ERROR: could not initialize ogg data at audio/interface/select/building/sel_civ_center.ogg

ERROR: OpenAL error: (null); called from COggData::~COggData (line 36)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 40)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 44)

ERROR: OpenAL error: (null); called from CSoundData::~CSoundData (line 37)

ERROR: OpenAL error: (null); called from CSoundData::~CSoundData (line 41)

ERROR: error loading sound: pathname=audio/interface/select/building/sel_civ_center.ogg, error=Function failed (no details available)
s0600204 accepted this revision.Jan 25 2018, 4:08 PM

I do have the issue, and I can confirm this fixes it. Thank you.

This revision was automatically updated to reflect the committed changes.