調用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