realnc / SDL_audiolib

An audio decoding, resampling and mixing library for SDL.
GNU Lesser General Public License v3.0
43 stars 8 forks source link

SDL_Audiolib incorrectly checks for `d->fRWops` even for non-RWOps streams #44

Open glebm opened 6 months ago

glebm commented 6 months ago

The latest commit doesn't work with DevilutionX because we have a custom decoder for videos that doesn't use rwops:

https://github.com/diasurgical/devilutionX/blob/master/Source/utils/push_aulib_decoder.h

The commit that breaks this is: https://github.com/realnc/SDL_audiolib/commit/b2df2dfeddc692caa01fd1e1769f59b285912b87

Here is how we create the stream:

https://github.com/diasurgical/devilutionX/blob/0f90d5babab49b804ec54137d9e336835dd73a60/Source/storm/storm_svid.cpp#L261C1-L263C129

Note that we explicitly pass /*rwops=*/nullptr and /*closeRw=*/false:

SVidAudioStream.emplace(/*rwops=*/nullptr, std::move(decoder), CreateAulibResampler(audioInfo.sampleRate), /*closeRw=*/false);

Is this a bug on our side or in SDL_audiolib?

/cc @StephenCWills @AJenbo