[PATCH 1/2] xaudio2: Fix support for FAudio 19.06 and newer

Chris Robinson chris.kcat at gmail.com
Thu May 2 23:52:33 CDT 2019


On 5/2/19 8:34 PM, Ethan Lee wrote:
> It looks like both __attribute__((deprecated)) and __declspec(deprecated) both support messages, so I can do that as well. I’d still throw in a big fat error message in at runtime just in case somebody attempts to update FAudio by itself.
> 
> The original CommitChanges was a stub since we didn’t support OperationSet at all; for all functions we treated all calls as if they submitted `COMMIT_NOW`, which runs the command immediately instead of queueing it for later.

If it originally did nothing, then IMO it can continue to do nothing. 
Old code will behave as it has (calls get submitted with COMMIT_NOW, 
CommitChanges is a no-op), while new code will get a deprecation warning 
if it tried to use CommitChanges.

> So by adding support for operation sets we’re not just changing behavior for one function, we’re changing behavior for a dozen functions, where any one function not falling in line can topple the whole thing over. This is also how we found the issue in the first place; because it was a stub and nobody was using operation sets, nobody noticed the bad signature.

If operation sets weren't supported before, and an app tried to use them 
anyway, it would already have issues. So I think it should be fine as 
long as CommitChanges does nothing when all previous OperationSets were 
COMMIT_NOW.

In this case, it may actually be more compatible to have CommitChanges() 
act as CommitChangesSet(COMMIT_ALL). For old apps that only used 
COMMIT_NOW, as they should have without operation set support, 
CommitChanges will do nothing since there's no operation sets to commit. 
Old apps that tried to use operation sets will at least get them 
committed with CommitChanges, even if they're committed at the wrong 
time (which was already happening anyway). If an old app tried to use 
operation sets and never called CommitChanges, it's out of luck.

For new apps, it can use operation sets and will be told to use 
CommitChangesSet or whatever, instead of CommitChanges.



More information about the wine-devel mailing list