]> git.sesse.net Git - vlc/blobdiff - src/control/video.c
Merge branch 'master' into lpcm_encoder
[vlc] / src / control / video.c
index 29ae7318f3997f36ac64b8eaafb61752fc264c56..2f122a54a18cc53ce55ed319b7316c58cc779830 100644 (file)
@@ -47,7 +47,10 @@ static vout_thread_t **GetVouts( libvlc_media_player_t *p_mi, size_t *n )
 {
     input_thread_t *p_input = libvlc_get_input_thread( p_mi );
     if( !p_input )
+    {
+        *n = 0;
         return NULL;
+    }
 
     vout_thread_t **pp_vouts;
     if (input_Control( p_input, INPUT_GET_VOUTS, &pp_vouts, n))
@@ -223,7 +226,7 @@ void libvlc_video_set_scale( libvlc_media_player_t *p_mp, float f_scale )
 {
     if (f_scale != 0.)
         var_SetFloat (p_mp, "scale", f_scale);
-    var_SetBool (p_mp, "autoscale", f_scale != 0.);
+    var_SetBool (p_mp, "autoscale", f_scale == 0.);
 
     /* Apply to current video outputs (if any) */
     size_t n;
@@ -234,7 +237,7 @@ void libvlc_video_set_scale( libvlc_media_player_t *p_mp, float f_scale )
 
         if (f_scale != 0.)
             var_SetFloat (p_vout, "scale", f_scale);
-        var_SetBool (p_mp, "autoscale", f_scale != 0.);
+        var_SetBool (p_vout, "autoscale", f_scale == 0.);
         vlc_object_release (p_vout);
     }
     free (pp_vouts);
@@ -283,7 +286,7 @@ int libvlc_video_get_spu( libvlc_media_player_t *p_mi )
     if( i_ret < 0 )
     {
         vlc_object_release( p_input_thread );
-        libvlc_printerr( "Subtitle informations not found" );
+        libvlc_printerr( "Subtitle information not found" );
         return -1;
     }
 
@@ -395,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);
     }