mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Merge pull request #1300 from jeapostrophe/master
Fixing audio/sync problems when gameplay is interrupted by call/etc
This commit is contained in:
commit
b6b3090dd1
@ -243,16 +243,18 @@ void switch_to_ios() {
|
||||
}
|
||||
|
||||
apple_gamecontroller_init();
|
||||
|
||||
apple_start_iteration();
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||
{
|
||||
apple_start_iteration();
|
||||
[self showGameView];
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application
|
||||
{
|
||||
apple_stop_iteration();
|
||||
[self showPauseMenu: self];
|
||||
}
|
||||
|
||||
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
|
||||
|
@ -27,7 +27,7 @@ void apple_start_iteration(void);
|
||||
|
||||
void apple_stop_iteration(void);
|
||||
|
||||
static CFRunLoopObserverRef iterate_observer;
|
||||
static CFRunLoopObserverRef iterate_observer = NULL;
|
||||
|
||||
static void do_iteration(void)
|
||||
{
|
||||
@ -103,17 +103,22 @@ static void do_iteration(void)
|
||||
|
||||
void apple_start_iteration(void)
|
||||
{
|
||||
iterate_observer = CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting,
|
||||
true, 0, (CFRunLoopObserverCallBack)do_iteration, 0);
|
||||
CFRunLoopAddObserver(CFRunLoopGetMain(), iterate_observer,
|
||||
kCFRunLoopCommonModes);
|
||||
if (iterate_observer == NULL) {
|
||||
iterate_observer =
|
||||
CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting,
|
||||
true, 0, (CFRunLoopObserverCallBack)do_iteration, 0);
|
||||
CFRunLoopAddObserver(CFRunLoopGetMain(), iterate_observer,
|
||||
kCFRunLoopCommonModes);
|
||||
}
|
||||
}
|
||||
|
||||
void apple_stop_iteration(void)
|
||||
{
|
||||
CFRunLoopObserverInvalidate(iterate_observer);
|
||||
CFRelease(iterate_observer);
|
||||
iterate_observer = 0;
|
||||
if (iterate_observer != NULL) {
|
||||
CFRunLoopObserverInvalidate(iterate_observer);
|
||||
CFRelease(iterate_observer);
|
||||
iterate_observer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void frontend_apple_get_environment_settings(int *argc, char *argv[],
|
||||
|
Loading…
x
Reference in New Issue
Block a user