gpt4 book ai didi

iOS 11 : Media Player crash

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:22:48 47 4
gpt4 key购买 nike

从 iOS 11 开始,我一直看到这种崩溃:

1 libdispatch.dylib _dispatch_sync_wait + 63192 2 MediaToolbox videoQueueRemote_Invalidate + 5984376 3 MediaToolbox videoQueueRemote_Invalidate + 5984376 4 MediaToolbox videoQueueRemote_Finalize + 5984828  5 CoreMedia FigBaseObjectFinalize + 47300  6 CoreFoundation _CFRelease + 963176  7 AVFoundation -[AVSampleBufferDisplayLayer dealloc] + 1467352  8 QuartzCore CA::Transaction::commit() + 745496  9 MediaToolbox FigLayerSynchronizerSynchronizeToMoment + 857340  10 MediaToolbox videoQueueRemote_SynchronizeLayerToMoment + 5994476  11 MediaToolbox figSyncMomentSource_sendMomentInternal + 852744  12 libdispatch.dylib _dispatch_client_callout + 6404  13 libdispatch.dylib _dispatch_queue_serial_drain$VARIANT$mp + 46184  14 libdispatch.dylib _dispatch_queue_invoke$VARIANT$mp + 48632  15 libdispatch.dylib _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 51244  16 libdispatch.dylib _dispatch_workloop_worker_thread$VARIANT$mp + 84560  17 libsystem_pthread.dylib _pthread_wqthread + 4680

只是想了解这是我的应用程序的问题还是苹果测试版的问题。

注意:问题是间歇性的。

最佳答案

我不知道媒体播放器框架,但我猜你使用 AVPlayer 来播放视频,因为 documentation

To enable users to play videos containing MPMediaItem objects, use AVPlayer. You cannot play video media items using the Media Player framework.

如果是这样,您可能使用 AVPlayerLayer 进行显示,这很可能在内部使用 AVSampleBufferDisplayLayer。这将是您的堆栈跟踪中的那个:

7 AVFoundation -[AVSampleBufferDisplayLayer dealloc] + 1467352

在直接使用 AVSampleBufferDisplayLayer 时,我遇到了同样的崩溃并在后台线程上看到了相同的堆栈跟踪。经过大量调试和测试后,我发现将所有涉及该层的代码移至主线程可以避免崩溃。 viewWill...viewDid... 回调是设置的好地方:

var player : AVPlayer!
var layer : AVPlayerLayer!
// var layer : AVSampleBufferDisplayLayer! // in my case

override func viewDidLoad() {
super.viewDidLoad()
self.layer = AVPlayerLayer(player: player)
// self.layer = AVSampleBufferDisplayLayer() // in my case
self.layer.frame = self.view.bounds
self.view.layer.addSublayer(self.layer)
}

enqueue(_ sampleBuffer: CMSampleBuffer)flush()flushAndRemoveImage() 在使用 时也是如此AVSampleBufferDisplayLayer.

关于iOS 11 : Media Player crash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45573203/

47 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com