浏览代码

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 年之前
父节点
当前提交
c2d36dd036
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Sources/VLCPlaybackController.m

+ 6 - 0
Sources/VLCPlaybackController.m

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