从 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/
这里有一个很好的答案解释了如何在Ruby中下载文件而不将其加载到内存中:https://stackoverflow.com/a/29743394/4852737require'open-uri'download=open('http://example.com/image.png')IO.copy_stream(download,'~/image.png')我如何验证下载文件的IO.copy_stream调用是否真的成功——这意味着下载的文件与我打算下载的文件完全相同,而不是下载一半的损坏文件?documentation说IO.copy_stream返回它复制的字节数,但是当我还没有下
我正在尝试解析一个文本文件,该文件每行包含可变数量的单词和数字,如下所示:foo4.500bar3.001.33foobar如何读取由空格而不是换行符分隔的文件?有什么方法可以设置File("file.txt").foreach方法以使用空格而不是换行符作为分隔符? 最佳答案 接受的答案将slurp文件,这可能是大文本文件的问题。更好的解决方案是IO.foreach.它是惯用的,将按字符流式传输文件:File.foreach(filename,""){|string|putsstring}包含“thisisanexample”结果的
运行bundleinstall后出现此错误:Gem::Package::FormatError:nometadatafoundin/Users/jeanosorio/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gemAnerroroccurredwhileinstallinglibv8(3.11.8.13),andBundlercannotcontinue.Makesurethat`geminstalllibv8-v'3.11.8.13'`succeedsbeforebundling.我试试gemin
1.错误信息:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:requestcanceledwhilewaitingforconnection(Client.Timeoutexceededwhileawaitingheaders)或者:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:TLShandshaketimeout2.报错原因:docker使用的镜像网址默认为国外,下载容易超时,需要修改成国内镜像地址(首先阿里
print"Enteryourpassword:"pass=STDIN.noecho(&:gets)puts"Yourpasswordis#{pass}!"输出:Enteryourpassword:input.rb:2:in`':undefinedmethod`noecho'for#>(NoMethodError) 最佳答案 一开始require'io/console'后来的Ruby1.9.3 关于ruby-为什么不能使用类IO的实例方法noecho?,我们在StackOverflow上
我正在运行Ubuntu11.10并像这样安装Ruby1.9:$sudoapt-getinstallruby1.9rubygems一切都运行良好,但ri似乎有空文档。ri告诉我文档是空的,我必须安装它们。我执行此操作是因为我读到它会有所帮助:$rdoc--all--ri现在,当我尝试打开任何文档时:$riArrayNothingknownaboutArray我搜索的其他所有内容都是一样的。 最佳答案 这个呢?apt-getinstallri1.8编辑或者试试这个:(非rvm)geminstallrdocrdoc-datardoc-da
我正在使用PostgreSQL9.1.3(x86_64-pc-linux-gnu上的PostgreSQL9.1.3,由gcc-4.6.real(Ubuntu/Linaro4.6.1-9ubuntu3)4.6.1,64位编译)和在ubuntu11.10上运行3.2.2或3.2.1。现在,我可以使用以下命令连接PostgreSQLsupostgres输入密码我可以看到postgres=#我将以下详细信息放在我的config/database.yml中并执行“railsdb”,它工作正常。开发:adapter:postgresqlencoding:utf8reconnect:falsedat
当我将IO::popen与不存在的命令一起使用时,我在屏幕上打印了一条错误消息:irb>IO.popen"fakefake"#=>#irb>(irb):1:commandnotfound:fakefake有什么方法可以捕获此错误,以便我可以在脚本中进行检查? 最佳答案 是:升级到ruby1.9。如果您在1.9中运行它,则会引发Errno::ENOENT,您将能够拯救它。(编辑)这是在1.8中的一种hackish方式:error=IO.pipe$stderr.reopenerror[1]pipe=IO.popen'qwe'#
我目前有一个运行Ruby1.8.7和Rails2.3.2的RubyonRails项目我有一些从数据库中读取数据的单元测试,特别是两个连续项目的日期时间列,这两个项目应该相隔24小时。在一项测试中,我将项目2的日期时间设置为与项目1的日期时间相同。当我执行断言以确保两个值相等时,测试在rails2.3.2下工作正常。当我升级到rails2.3.11时,测试失败显示两次之间的差异将关闭并出现以下错误:expectedbutwas.这两个版本的rails中似乎存在浮点转换问题。如何解决float问题? 最佳答案 这也发生在我身上,我最终这
当我尝试使用“套接字”库中的方法“read_nonblock”时出现以下错误IO::EAGAINWaitReadable:Resourcetemporarilyunavailable-readwouldblock但是当我通过终端上的IRB尝试时它工作正常如何让它读取缓冲区? 最佳答案 IgetthefollowingerrorwhenItrytousethemethod"read_nonblock"fromthe"socket"library当缓冲区中的数据未准备好时,这是预期的行为。由于异常IO::EAGAINWaitReadab