调用C方法对于以下代码返回(不建立ARC)应的属性归因作为保留,如果是从由参考
中.H@interface VideoFrameExtractor : NSObject {
AVFormatContext *pFormatCtx;
AVCodecContext *pCodecCtx;
}
在.M
int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
AVInputFormat *fmt,
int buf_size,
AVFormatParameters *ap);
// Open video file
if(av_open_input_file(&pFormatCtx, [moviePath cStringUsingEncoding:NSASCIIStringEncoding], NULL, 0, NULL)!=0)
goto initError; // Couldn't open file
// Retrieve stream information
if(av_find_stream_info(pFormatCtx)<0)
goto initError; // Couldn't find stream information
我们应该将pFormatCtx属性的属性设置为保留还是其他?问这个问题的原因是我们在引用av_find_stream_info调用中的属性时遇到了EXC_BAD_ACCESS错误。
是来自ffmpeg的av_open_input_file和av_find_stream_info? – sergio 2012-07-24 07:55:48
是的,只需使用llvm-gcc构建ffmpeg,然后尝试在iPhone模拟器上运行iFrameExtractor应用程序(使用ffmpeg)。立即出现问题 – tom 2012-07-24 08:02:05