mirror of
https://github.com/libretro/RetroArch
synced 2025-03-19 16:21:30 +00:00
apple: don't allow opening sdl2 microphone if not using sdl2 audio (#16989)
This commit is contained in:
parent
14b1af9e1a
commit
6e2f0a4f30
@ -132,6 +132,16 @@ static void *sdl_microphone_open_mic(void *driver_context,
|
||||
SDL_AudioSpec desired_spec = {0};
|
||||
void *tmp = NULL;
|
||||
|
||||
#if __APPLE__
|
||||
if (!string_is_equal(audio_driver_get_ident(), "sdl2"))
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SDL2_MIC_NEEDS_SDL2_AUDIO), 1, 100, true, NULL,
|
||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_WARNING);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If the audio driver wasn't initialized yet... */
|
||||
if (!SDL_WasInit(SDL_INIT_AUDIO))
|
||||
{
|
||||
|
@ -521,10 +521,15 @@ static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AUDIOIO;
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_OSS;
|
||||
#elif defined(HAVE_JACK)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_JACK;
|
||||
#elif defined(HAVE_COREAUDIO3) || defined(HAVE_COREAUDIO)
|
||||
/* SDL microphone does not play well with coreaudio audio driver */
|
||||
#if defined(HAVE_SDL2) && defined(HAVE_MICROPHONE)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_SDL2;
|
||||
#elif defined(HAVE_COREAUDIO3)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO3;
|
||||
#elif defined(HAVE_COREAUDIO)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO;
|
||||
#endif
|
||||
#elif defined(HAVE_WASAPI)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WASAPI;
|
||||
#elif defined(HAVE_XAUDIO)
|
||||
|
@ -16558,6 +16558,10 @@ MSG_HASH(
|
||||
MSG_IOS_TOUCH_MOUSE_DISABLED,
|
||||
"Touch mouse is disabled"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_SDL2_MIC_NEEDS_SDL2_AUDIO,
|
||||
"sdl2 microphone requires sdl2 audio driver"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_ACCESSIBILITY_STARTUP,
|
||||
"RetroArch accessibility on. Main Menu Load Core."
|
||||
|
@ -578,6 +578,7 @@ enum msg_hash_enums
|
||||
|
||||
MSG_IOS_TOUCH_MOUSE_ENABLED,
|
||||
MSG_IOS_TOUCH_MOUSE_DISABLED,
|
||||
MSG_SDL2_MIC_NEEDS_SDL2_AUDIO,
|
||||
|
||||
/* Add To Playlist*/
|
||||
MSG_ADDED_TO_PLAYLIST,
|
||||
|
@ -51,6 +51,11 @@
|
||||
#import <GameController/GCMouse.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SDL2
|
||||
#define SDL_MAIN_HANDLED
|
||||
#include "SDL.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOA_METAL) || defined(HAVE_COCOATOUCH)
|
||||
#import "JITSupport.h"
|
||||
id<ApplePlatform> apple_platform;
|
||||
@ -963,6 +968,9 @@ int main(int argc, char *argv[])
|
||||
RARCH_LOG("Ptrace hack complete, JIT support is enabled.\n");
|
||||
else
|
||||
RARCH_WARN("Ptrace hack NOT available; Please use an app like Jitterbug.\n");
|
||||
#endif
|
||||
#ifdef HAVE_SDL2
|
||||
SDL_SetMainReady();
|
||||
#endif
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, NSStringFromClass([RApplication class]), NSStringFromClass([RetroArch_iOS class]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user