开发者

copyNextSampleBuffer after application returns from background on iPhone

开发者 https://www.devze.com 2023-02-07 14:47 出处:网络
I\'m reading a video file using: CMSampleBufferRef sampleBuffer = [asset_reader_output copyNextSampleBuffer];

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

精彩评论

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