Feature #671

Converting sdlout.cc to SDL2

Added by Jim Turner 6 months ago. Updated 5 months ago.

Status:Rejected Start date:October 23, 2016
Priority:Minor Due date:
Assignee:- % Done:

0%

Category:plugins/sdlout
Target version:3.9
Affects version:3.8

Description

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!

Regards,

Jim Turner

sdlout_sdl2.cc Magnifier - SDL2 version of sdlout.cc (8.2 kB) Jim Turner, October 23, 2016 20:58

sdlout.diff Magnifier - diff -p against v3.8 sdlout.cc (2.8 kB) Jim Turner, October 23, 2016 20:58

History

#1 Updated by John Lindgren 6 months ago

What good does this do? sdlout already supports SDL2.

#2 Updated by Jim Turner 6 months 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 5 months ago

  • Status changed from New to Rejected

The old API is slightly easier to use, and I prefer it for that reason.

Also available in: Atom PDF