From c6464e8ebf846fc279ee448a15f61175f289c05c Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Fri, 2 Jul 2010 05:43:25 +0300 Subject: [PATCH] Fix libvlc_video_set_crop_geometry() to accept custom values (untested) --- src/control/video.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/control/video.c b/src/control/video.c index e0772dc8dd..60a1cee9b4 100644 --- a/src/control/video.c +++ b/src/control/video.c @@ -398,7 +398,14 @@ void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, for (size_t i = 0; i < n; i++) { vout_thread_t *p_vout = pp_vouts[i]; - + vlc_value_t val; + + /* Make sure the geometry is in the choice list */ + /* Earlier choices are removed to not grow a long list over time. */ + /* FIXME: not atomic - lock? */ + val.psz_string = (char *)psz_geometry; + var_Change (p_vout, "crop", VLC_VAR_CLEARCHOICES, NULL, NULL); + var_Change (p_vout, "crop", VLC_VAR_ADDCHOICE, &val, &val); var_SetString (p_vout, "crop", psz_geometry); vlc_object_release (p_vout); } -- 2.39.5