GNOME Bugzilla – Bug 711606
applemedia: coremediabuffer: use correct retain/release functions on CMSampleBufferRef buffer
Last modified: 2013-11-08 14:36:26 UTC
CFRetain/CFRelease should be used instead of CVBufferRetain/CVBufferRelease according to the documentation. It fixes a crash while releasing the sample buffer after the image buffer it contains. Also fixes a minor coding style error.
Created attachment 259178 [details] [review] applemedia: coremediabuffer: use correct retain/release functions on CMSampleBufferRef buffer
Created attachment 259183 [details] [review] applemedia: coremediabuffer: use correct retain/release functions on CMSampleBufferRef buffer Added bugzilla link to comments.
commit 78f104aa61d03fe5e29cc7b9c63077ba4e134d3a Author: Matthieu Bouron <matthieu.bouron@collabora.com> Date: Thu Nov 7 12:29:48 2013 +0000 applemedia: coremediabuffer: use correct retain/release functions on CMSampleBufferRef buffer Fixes a crash while releasing the sample buffer after the image buffer it contains. Also fixes a minor coding style error. https://bugzilla.gnome.org/show_bug.cgi?id=711606
We should probably keep an extra ref to the block_buf and image_buf and release them in the free function. From the docs for CMSampleBufferGetDataBuffer and CMSampleBufferGetImageBuffer: "The caller does not own the returned dataBuffer, and must retain it explicitly if the caller needs to maintain a reference to it."
Created attachment 259222 [details] [review] 0001-coremediabuffer-keep-an-extra-ref-to-the-image-and-d.patch
commit 31d7c421583afb3d797abfd5e6466dcb54daab5c Author: Andoni Morales Alastruey <ylatuya@gmail.com> Date: Thu Nov 7 21:37:29 2013 +0100 coremediabuffer: keep an extra ref to the image and data buffer