From aa7564696efe0c6859f7e61f11734a05149ec631 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Mon, 5 Oct 2015 18:54:43 +0200
Subject: [PATCH] videotoolbox: fetch config early enough for late start, set
 OpenGL compat key

---
 modules/codec/videotoolbox.m | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 782d0f47c0da..4a5352bd694a 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -261,6 +261,7 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
     CFDictionarySetValue(decoderConfiguration,
                          kCVImageBufferChromaLocationTopFieldKey,
                          kCVImageBufferChromaLocation_Left);
+    p_sys->b_zero_copy = var_InheritBool(p_dec, "videotoolbox-zero-copy");
 
     /* fetch extradata */
     CFMutableDictionaryRef extradata_info = NULL;
@@ -476,19 +477,16 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
         return VLC_EGENERIC;
     }
 
-    p_sys->b_zero_copy = var_InheritBool(p_dec, "videotoolbox-zero-copy");
-
     /* destination pixel buffer attributes */
     CFMutableDictionaryRef dpba = CFDictionaryCreateMutable(kCFAllocatorDefault,
                                                             2,
                                                             &kCFTypeDictionaryKeyCallBacks,
                                                             &kCFTypeDictionaryValueCallBacks);
-    /* we need to change the following keys for convienence
-     * conversations as soon as we have a 0-copy pipeline */
+
 #if !TARGET_OS_IPHONE
     CFDictionarySetValue(dpba,
                          kCVPixelBufferOpenGLCompatibilityKey,
-                         kCFBooleanFalse);
+                         kCFBooleanTrue);
 #else
     CFDictionarySetValue(dpba,
                          kCVPixelBufferOpenGLESCompatibilityKey,
-- 
GitLab