From 5977ef5552f89fc1cd52a5331a1650a0508c29a0 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Wed, 12 Nov 2014 16:45:12 +0100 Subject: [PATCH] vtenc: fix build on iOS --- sys/applemedia/vtenc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c index 5e48c8b1c9..3978e4ec74 100644 --- a/sys/applemedia/vtenc.c +++ b/sys/applemedia/vtenc.c @@ -527,14 +527,16 @@ static VTCompressionSessionRef gst_vtenc_create_session (GstVTEnc * self) { VTCompressionSessionRef session = NULL; - CFMutableDictionaryRef encoder_spec, pb_attrs; + CFMutableDictionaryRef encoder_spec = NULL, pb_attrs; OSStatus status; +#if !HAVE_IOS encoder_spec = CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); gst_vtutil_dict_set_boolean (encoder_spec, kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, true); +#endif pb_attrs = CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); @@ -600,7 +602,8 @@ gst_vtenc_create_session (GstVTEnc * self) #endif beach: - CFRelease (encoder_spec); + if (encoder_spec) + CFRelease (encoder_spec); CFRelease (pb_attrs); return session;