Converting sdlout.cc to SDL2
Due to some work (on Fauxdacious v3.8b1) I'm doing (to redo the ffaudio video option using SDL2), I ended up converting the sdlout plugin to SDL2 and thought you might be interested in either just merging or possibly also adding "#if SDL==1" and "#if SDL==2" preprocessor blocks and including both API calls since you already have configure option for "--with-libsdl=1,2" and the included patch is only for SDL2.
As an asside, do you know of a good way off the top of your head to force execution of a function call (ie. SDL_CreateWindow ()) within a plugin to be done in the "main thread", as SDL2 requires windows to be created within the program's "main thread" (else memory gets corrupted)? I can create the window hidden in FFaudio::init (), but it'll only work once unless that plugin is "re-scanned" EVERY time the audacious is started up, but this seems like a really crappy way to do it!
#1 Updated by John Lindgren over 6 years ago
What good does this do? sdlout already supports SDL2.
#2 Updated by Jim Turner over 6 years ago
Nothing functionality-wise (currently)
From: https://wiki.libsdl.org/SDL_OpenAudio?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29: "This function remains for compatibility with SDL 1.2, but also because it's slightly easier to use than the new functions in SDL 2.0. The new, more powerful, and preferred way to do this is SDL_OpenAudioDevice()."
I did this in the process of converting my video stuff to SDL2 calls, and wanted to just pass it along, since the SDL guys suggest it, so I just thought I'd pass it along. For all I knew, you might've been planning to update that as you did libav/ffmpeg calls and a lot of other core stuff recently. If you're not interested, then simply disregard.
#3 Updated by John Lindgren over 6 years ago
- Status changed from New to Rejected
The old API is slightly easier to use, and I prefer it for that reason.