copyNextSampleBuffer after application returns fro

2019-04-06 21:34发布

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 and 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?

1条回答
戒情不戒烟
2楼-- · 2019-04-06 22:16

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

查看更多
登录 后发表回答