-From 1cfa3cc52c34469bbd5199b91089661320fd7ef6 Mon Sep 17 00:00:00 2001
+From 7a64d54c92c295463ba2a1ceedf422c8feed2d76 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Mon, 31 Mar 2014 17:54:01 +0200
 Subject: [PATCH] libvlc: add preliminary code path to modify quartztext
  variables on-the-fly
 
 ---
- include/vlc/libvlc_media_player.h  | 21 +++++++++++++++
+ include/vlc/libvlc_media_player.h  | 21 +++++++++++++
  lib/libvlc.sym                     |  4 +++
- lib/media_player.c                 |  7 +++++
- lib/video.c                        | 47 ++++++++++++++++++++++++++++++++++
- modules/text_renderer/quartztext.c | 52 +++++++++++++++++++++++++++++++++-----
- 5 files changed, 125 insertions(+), 6 deletions(-)
+ lib/media_player.c                 |  6 ++++
+ lib/video.c                        | 47 +++++++++++++++++++++++++++++
+ modules/text_renderer/quartztext.c | 61 ++++++++++++++++++++++++++++++++------
+ 5 files changed, 130 insertions(+), 9 deletions(-)
 
 diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
 index fb91f59..47996f0 100644

+    var_DelCallback( p_filter, "quartztext-color", QuartztextCallback, p_sys );
+    vlc_mutex_destroy( &p_sys->lock );
+
 #ifndef TARGET_OS_IPHONE
     if (p_sys->p_fonts) {
         for (int k = 0; k < p_sys->i_fonts; k++) {
@@ -959,7 +978,8 @@ static int GetFontSize(filter_t *p_filter)
 {
     int i_size = 0;
 
-    int i_ratio = var_CreateGetInteger( p_filter, "quartztext-rel-fontsize" );
+    int i_ratio = var_CreateGetIntegerCommand( p_filter, "quartztext-fontsize" );
+    msg_Err(p_filter, "ratio is %i", i_ratio);
     if( i_ratio > 0 )
         i_size = (int)p_filter->fmt_out.video.i_height / i_ratio;
 
@@ -1048,3 +1068,23 @@ static int RenderYUVA(filter_t *p_filter, subpicture_region_t *p_region,
 
     return VLC_SUCCESS;
 }

 libvlc_video_take_snapshot
 libvlc_vlm_add_broadcast
diff --git a/lib/media_player.c b/lib/media_player.c
index 7027bf4..bd8d37c 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -464,6 +464,12 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     var_Create (mp, "saturation", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
     var_Create (mp, "gamma", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
 
+#ifdef __APPLE__
+    var_Create (mp, "quartztext-font", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
+    var_Create (mp, "quartztext-fontsize", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+    var_Create (mp, "quartztext-color", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
