如何解决由于EXC_GUARD
在我的macOS应用中,我启动ffmpeg任务以检索媒体文件信息。
由于EXC_GUARD,我收到很多崩溃消息:
Exception Type: EXC_GUARD
Exception Codes: 0x4000000200000001,0xd71a2ae8e8dab339
Exception Subtype: GUARD_TYPE_FD,id=0xd71a2ae8e8dab339,fd=1,flavor=0x00000002 (DUP)
这是我使用的代码:
NSArray *ffmpegArgs = [NSArray arrayWithObjects:@"-hide_banner",@"-nostdin",@"-nostats",@"-i",self.media.path,nil];
self.task = [[NSTask alloc] init];
[self.task setLaunchPath:[[NSBundle mainBundle] pathForResource:@"ffmpeg" ofType:nil]];
[self.task setArguments:ffmpegArgs];
NSPipe *errorPipe = [NSPipe pipe];
self.task.standardError = errorPipe;
NSFileHandle *errorHandle = [errorPipe fileHandleForReading];
@try {
[self.task launch];
} @catch (NSException *exception) {
NSLog(@"An exception %@ was thrown while attempting to launch the ffmpeg task with arguments: %@.",exception.description,[ffmpegArgs componentsJoinedByString:@" "]);
[errorHandle closeFile];
return;
}
[self.task waitUntilExit];
NSData *outputData = [errorHandle readDataToEndOfFile];
[errorHandle closeFile];
我无法在设备上重现此崩溃。
有人可以帮助我吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。