Browse Source

vlc: ignore configuration changed events

This kind of events should not be handled here. It happens when switching from
Stereo to 5.1 on HDMI for example.
Thomas Guillem 8 years ago
parent
commit
c2d36dd036
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Sources/VLCPlaybackController.m

+ 6 - 0
Sources/VLCPlaybackController.m

@@ -833,6 +833,12 @@ VLCMediaDelegate>
 
 
 - (void)audioSessionRouteChange:(NSNotification *)notification
 - (void)audioSessionRouteChange:(NSNotification *)notification
 {
 {
+    NSDictionary *userInfo = notification.userInfo;
+    NSInteger routeChangeReason = [[userInfo valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue];
+
+    if (routeChangeReason == AVAudioSessionRouteChangeReasonRouteConfigurationChange)
+        return;
+
     BOOL headphonesPlugged = [self areHeadphonesPlugged];
     BOOL headphonesPlugged = [self areHeadphonesPlugged];
 
 
     if (_headphonesWasPlugged && !headphonesPlugged && [_mediaPlayer isPlaying]) {
     if (_headphonesWasPlugged && !headphonesPlugged && [_mediaPlayer isPlaying]) {