Project

General

Profile

Feature #671

Converting sdlout.cc to SDL2

Added by Jim Turner about 8 years ago. Updated almost 8 years ago.

Status:
Rejected
Priority:
Minor
Assignee:
-
Category:
plugins/sdlout
Target version:
Start date:
October 23, 2016
Due date:
% Done:

0%

Estimated time:
Affects version:

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 (8.25 KB) sdlout_sdl2.cc SDL2 version of sdlout.cc Jim Turner, October 23, 2016 20:58
sdlout.diff (2.82 KB) sdlout.diff diff -p against v3.8 sdlout.cc Jim Turner, October 23, 2016 20:58

History

#1 Updated by John Lindgren about 8 years ago

What good does this do? sdlout already supports SDL2.

#2 Updated by Jim Turner about 8 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 almost 8 years 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