I have code that creates CMBlockBuffers and then creates a CMSampleBuffer and passes it to AVAssetWriterInput.
What is the memory management deal here? According to Apple documentation, everything you use with 'Create' in a name must be released with CFRelease .
However, if I use CFRelease, my application fails with a malloc: * error for object 0xblahblah: the freed pointer was not allocated.
CMBlockBufferRef tmp_bbuf = NULL; CMBlockBufferRef bbuf = NULL; CMSampleBufferRef sbuf = NULL; status = CMBlockBufferCreateWithMemoryBlock( kCFAllocatorDefault, samples, buflen, kCFAllocatorDefault, NULL, 0, buflen, 0, &tmp_bbuf); if (status != noErr || !tmp_bbuf) { NSLog(@"CMBlockBufferCreateWithMemoryBlock error"); return -1; }
So, should CFRelease use CFRelease in this code?
objective-c iphone avfoundation core-media
Pete
source share