开发者

copyNextSampleBuffer after application returns from background on iPhone

I'm reading a video file using:

CMSampleBufferRef sampleBuffer = [asset_reader_output copyNextSampleBuffer];

where asset_reader_output is an instance of AVAssetReaderTrackOutput class.

this works well, but if the application goes to the background a开发者_运维百科nd then returns (for instance, if a phone call was received), then after returning to the application, copyNextSampleBuffer always return nil.

why is it returning nil and not the actual data? how can i solve this problem?


try to track on current sample buffer. Then, in your addDelegate class, you have callback methods applicationDidEnterBackground and applicationWillEnterForeground. just set current semple buffer marker at right place before calling copyNextSampleBuffer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜