【问题标题】:VLCMobileKit iOS crash on screen lock on iPhone 4iPhone 4 屏幕锁定时 VLCMobileKit iOS 崩溃
【发布时间】:2014-03-03 12:47:08
【问题描述】:

我在 iOS 的 MobileVLCKit 中遇到了一个奇怪的问题。我在我的应用程序中播放 RTSP 链接。我已在我的应用程序中将在后台播放音频和视频的标志设置为 true。因此,当应用程序进入后台时,我的 VLC 播放器中播放的视频会继续播放,没有任何问题。 但是在 iPhone 4(使用 iOS 7.0.4)上,当我在播放视频时锁定我的 iPhone 屏幕时,应用程序崩溃而不显示任何日志。奇怪的是,如果我通过按主页按钮在后台发送应用程序,那么应用程序不会崩溃。该问题仅在 iPhone 4 上,而不在 iPhone 5 上。 以前有人遇到过这样的问题吗?

下面是设备崩溃日志:

May 27 03:18:41 My-iPhone-VI kernel[0] <Debug>: 019323.846533 wlan.A[400] AppleBCMWLANNetManager::updateLinkQualityMetrics(): Report LQM to User Land 100, fAverageRSSI -69
May 27 03:18:41 My-iPhone-VI kernel[0] <Debug>: ALS: AppleARMBacklight::setBacklightEnableGated 0 (set level to 0x1c8)
May 27 03:18:41 My-iPhone-VI kernel[0] <Debug>: AppleMultitouchN1SPI: updating power statistics
May 27 03:18:41 My-iPhone-VI kernel[0] <Debug>: ALS: AppleARMBacklight::handleMessageGated - framebufferState -> 0
May 27 03:18:41 My-iPhone-VI backboardd[28] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=0
May 27 03:18:41 My-iPhone-VI SpringBoard[34] <Warning>: [MPUNowPlayingController] Not registered for now playing notifications. Ignoring call to -unregisterForNotifications.
May 27 03:18:41 My-iPhone-VI backboardd[28] <Notice>: MultitouchHID: detection mode: 0->255
May 27 03:18:41 My-iPhone-VI MyApp[817] <Warning>: log: applicationWillResignActive
May 27 03:18:41 My-iPhone-VI MyApp[817] <Warning>: log: applicationDidEnterBackground
May 27 03:18:42 My-iPhone-VI profiled[818] <Notice>: (Note ) profiled: Service starting...
May 27 03:18:42 My-iPhone-VI ReportCrash[819] <Notice>: ReportCrash acting against PID 817
May 27 03:18:43 My-iPhone-VI ReportCrash[819] <Notice>: Formulating crash report for process MyApp[817]
May 27 03:18:43 My-iPhone-VI com.apple.launchd[1] (UIKitApplication:com.My.MyApp[0x19d8][817]) <Warning>: (UIKitApplication:com.My.MyApp[0x19d8]) Job appears to have crashed: Segmentation fault: 11
May 27 03:18:43 My-iPhone-VI backboardd[28] <Warning>: Application 'UIKitApplication:com.My.MyApp[0x19d8]' exited abnormally with signal 11: Segmentation fault: 11
May 27 03:18:43 My-iPhone-VI mediaserverd[46] <Warning>: Encountered an XPC error while communicating with backboardd: <error: 0x3cd9f744> { count = 1, contents =
    "XPCErrorDescription" => <string: 0x3cd9f9dc> { length = 22, contents = "Connection interrupted" }
}
May 27 03:18:43 My-iPhone-VI ReportCrash[819] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/MyApp_2014-05-27-031842_My-iPhone-VI.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
May 27 03:18:53 My-iPhone-VI profiled[818] <Notice>: (Note ) profiled: Service stopping.

下面是方法 didEnterBackground:

中的堆栈跟踪
 Stack trace : (
0   MyApp                           0x0010a191 -[MyAppAppDelegate applicationDidEnterBackground:] + 76
1   UIKit                               0x2fc85543 <redacted> + 590
2   UIKit                               0x2fc06ae1 <redacted> + 764
3   UIKit                               0x2fc06721 <redacted> + 72
4   UIKit                               0x2fc6bb3d <redacted> + 664
5   GraphicsServices                    0x320a270d <redacted> + 608
6   GraphicsServices                    0x320a22f7 <redacted> + 34
7   CoreFoundation                      0x2d4599df <redacted> + 34
8   CoreFoundation                      0x2d45997b <redacted> + 346
9   CoreFoundation                      0x2d45814f <redacted> + 1398
10  CoreFoundation                      0x2d3c2c27 CFRunLoopRunSpecific + 522
11  CoreFoundation                      0x2d3c2a0b CFRunLoopRunInMode + 106
12  GraphicsServices                    0x320a1283 GSEventRunModal + 138
13  UIKit                               0x2fc66049 UIApplicationMain + 1136
14  MyApp                           0x001078e9 main + 116
15  libdyld.dylib                       0x37d26ab7 <redacted> + 2
)

【问题讨论】:

  • 发布日志调试器输出和此错误的堆栈跟踪。不可能没有任何日志。启动应用程序从 Xcode 发送到后台并锁定设备。
  • @rckoenes:我用设备崩溃日志更新了答案。
  • @rckoenes:我在问题中添加了堆栈跟踪。
  • @Yogi 我遇到了和你在这里描述的一样的问题,你的问题解决了吗?
  • @brianLikeApple:这可以在 VLC 的原生 iOS 应用程序中重现。我没有得到任何解决方案。您可以向 feepk 询问,因为他是 VLC 的首席开发人员

标签: ios video-streaming vlc rtsp libvlc


【解决方案1】:

您需要在进入后台状态之前禁用视频解码。否则,MobileVLCKit 将尝试在后台绘制 OpenGL 内容,这将被操作系统通过终止应用程序来阻止。

您可以通过将媒体播放器实例上的当前视频轨道设置为 -1 来禁用视频解码。一旦您的应用再次移动到前台,请将其切换回当前解码的视频轨道(因此,如果您的流包含多个视频轨道,则应将其缓存)。 禁用视频解码时,音频解码不受影响,将继续正常。这种方法还具有节省 CPU 负载和电池的好处.. ;)

这也是 VLC for iOS 的工作原理。 :)

【讨论】:

  • 嗨,感谢您一直都在。我试过你提到的东西。我在applicationWillResignActive: 中设置self.objGlobalVLC.currentVideoTrackIndex=-1 并再次在applicationDidBecomeActive: 中设置self.objGlobalVLC.currentVideoTrackIndex=-0。但这并不能解决问题。有趣的是,当我在其中播放 RTSP 链接时,VideoLAN 的 VLC 应用程序中重现了完全相同的问题。
  • 我已将堆栈跟踪添加到问题中。
  • 现在从后台应用程序回来后也不会在其他设备中流式传输。即它没有崩溃,但停止了流式传输。调用 play 方法也不起作用。
  • @feepk 我试过这个,但没有运气。能否请您提供更多详细信息?谢谢
  • MobileVLCKit 库的新版本修复了这个问题
【解决方案2】:

我认为您需要在进入后台状态之前禁用视频解码,这肯定会起作用,这是 Apple 表示即将修复主屏幕崩溃的主要内容,您也可以在此处阅读更多信息How to take a screenshot on iphone without using lock button

【讨论】:

  • 谢谢。我会试试这个,很快就会告诉你结果。
猜你喜欢
  • 1970-01-01
  • 2013-04-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-06-24
相关资源
最近更新 更多