From: Andoni Morales Alastruey Date: Thu, 7 Nov 2013 20:37:29 +0000 (+0100) Subject: coremediabuffer: keep an extra ref to the image and data buffer X-Git-Tag: 1.19.3~507^2~12963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31d7c421583afb3d797abfd5e6466dcb54daab5c;p=platform%2Fupstream%2Fgstreamer.git coremediabuffer: keep an extra ref to the image and data buffer --- diff --git a/sys/applemedia/coremediabuffer.c b/sys/applemedia/coremediabuffer.c index cf48154..56c38bc 100644 --- a/sys/applemedia/coremediabuffer.c +++ b/sys/applemedia/coremediabuffer.c @@ -22,9 +22,14 @@ static void gst_core_media_meta_free (GstCoreMediaMeta * meta, GstBuffer * buf) { - if (meta->image_buf != NULL) + if (meta->image_buf != NULL) { CVPixelBufferUnlockBaseAddress (meta->image_buf, kCVPixelBufferLock_ReadOnly); + CVBufferRelease(meta->image_buf); + } + if (meta->block_buf != NULL) { + CFRelease (meta->block_buf); + } CFRelease (meta->sample_buf); } @@ -112,6 +117,10 @@ gst_core_media_buffer_new (CMSampleBufferRef sample_buf) meta = (GstCoreMediaMeta *) gst_buffer_add_meta (buf, gst_core_media_meta_get_info (), NULL); CFRetain (sample_buf); + if (image_buf) + CVBufferRetain (image_buf); + if (block_buf) + CFRetain (block_buf); meta->sample_buf = sample_buf; meta->image_buf = image_buf; meta->pixel_buf = pixel_buf;