Bug 3776 - OpenAL system reports errors inappropriately
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Sound
Version: GIT MASTER
Hardware: PC Linux
: P3 major
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2008-09-12 19:48 EDT by Ben Millwood
Modified: 2009-10-13 11:23:48 EDT
1 user (show)

See Also:


Attachments
addition and use of S_AL_ClearError (1.40 KB, patch)
2008-09-12 19:48 EDT, Ben Millwood

Description Ben Millwood 2008-09-12 19:48:18 EDT
The OpenAL code frequently uses qalGetError() to test if a previously executed function failed: however, if it succeeded, but a function called earlier failed, then an error is still reported: at best this will result in an erroneous message, but in some cases the code will fall back on defaults unnecessarily.

Wrapping every function call that might give an error (but in real use probably won't) is time-consuming and difficult, so instead I propose the following to ensure the error state is cleared before execution of the function to be tested. When called with qtrue, it simply eats the error; if called with qfalse (as it is in every case included here) it prints a diagnostic message warning that an unhandled error was found.

The two specific bugs which led me to discover this problem I will submit in separate reports.
Comment 1 Ben Millwood 2008-09-12 19:48:56 EDT
Created attachment 1862 [details]
addition and use of S_AL_ClearError
Comment 2 Thilo Schulz 2009-10-13 11:23:48 EDT
Thank you, applied.