Forráskód Böngészése

playback view: fix most frequent crash #2 by making sure that we don't ever do any OpenGL while in the background

Felix Paul Kühne 12 éve
szülő
commit
91ae8e07ec
1 módosított fájl, 8 hozzáadás és 4 törlés
  1. 8 4
      AspenProject/VLCMovieViewController.m

+ 8 - 4
AspenProject/VLCMovieViewController.m

@@ -965,11 +965,14 @@
 {
     [self _saveCurrentState];
 
+    _mediaPlayer.currentVideoTrackIndex = 0;
+
     if (![[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingContinueAudioInBackgroundKey] boolValue]) {
         [_mediaPlayer pause];
         _shouldResumePlaying = YES;
-    } else
-        _mediaPlayer.currentVideoTrackIndex = 0;
+    }
+
+    glFinish();
 }
 
 - (void)applicationDidEnterBackground:(NSNotification *)notification
@@ -979,11 +982,12 @@
 
 - (void)applicationDidBecomeActive:(NSNotification *)notification
 {
+    _mediaPlayer.currentVideoTrackIndex = 1;
+
     if (_shouldResumePlaying) {
         _shouldResumePlaying = NO;
         [_mediaPlayer play];
-    } else
-        _mediaPlayer.currentVideoTrackIndex = 1;
+    }
 }
 
 - (void)_updateExportedPlaybackInformation