]> git.sesse.net Git - vlc/blobdiff - src/control/video.c
fix calloc usage.
[vlc] / src / control / video.c
index e4720e9fbe9a1762bf39ca7afd6aecafc24212a9..78786988448486ef981b0d68345ae3ae8f44eb7a 100644 (file)
@@ -97,13 +97,11 @@ void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi,
 {
     /* We only work on the first vout */
     vout_thread_t *p_vout = GetVout( p_mi, p_e );
-    bool ret;
 
     /* GetVout will raise the exception for us */
     if( !p_vout ) return;
 
-    ret = var_GetBool( p_vout, "fullscreen" );
-    var_SetBool( p_vout, "fullscreen", !ret );
+    var_ToggleBool( p_vout, "fullscreen" );
 
     vlc_object_release( p_vout );
 }
@@ -222,10 +220,10 @@ void libvlc_video_set_scale( libvlc_media_player_t *p_mp, float f_scale,
 char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi,
                                      libvlc_exception_t *p_e )
 {
-    char *psz_aspect = 0;
+    char *psz_aspect = NULL;
     vout_thread_t *p_vout = GetVout( p_mi, p_e );
 
-    if( !p_vout ) return 0;
+    if( !p_vout ) return NULL;
 
     psz_aspect = var_GetNonEmptyString( p_vout, "aspect-ratio" );
     vlc_object_release( p_vout );
@@ -233,7 +231,7 @@ char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi,
 }
 
 void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi,
-                                    char *psz_aspect, libvlc_exception_t *p_e )
+                                    const char *psz_aspect, libvlc_exception_t *p_e )
 {
     vout_thread_t *p_vout = GetVout( p_mi, p_e );
     int i_ret = -1;
@@ -341,7 +339,7 @@ end:
 }
 
 int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi,
-                                    char *psz_subtitle,
+                                    const char *psz_subtitle,
                                     libvlc_exception_t *p_e )
 {
     input_thread_t *p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
@@ -387,7 +385,7 @@ char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi,
 }
 
 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi,
-                                    char *psz_geometry, libvlc_exception_t *p_e )
+                                     const char *psz_geometry, libvlc_exception_t *p_e )
 {
     vout_thread_t *p_vout = GetVout( p_mi, p_e );
     int i_ret = -1;
@@ -683,7 +681,7 @@ static vlc_object_t *get_marquee_object( libvlc_media_player_t * p_mi )
  * libvlc_video_get_marquee_option_as_int : get a marq option value
  *****************************************************************************/
 int libvlc_video_get_marquee_option_as_int( libvlc_media_player_t *p_mi,
-                                            unsigned option,
+                                            libvlc_video_marquee_int_option_t option,
                                             libvlc_exception_t *p_e )
 {
     const char * identifier = get_marquee_int_option_identifier(option);
@@ -717,7 +715,7 @@ int libvlc_video_get_marquee_option_as_int( libvlc_media_player_t *p_mi,
  * libvlc_video_get_marquee_option_as_string : get a marq option value
  *****************************************************************************/
 char * libvlc_video_get_marquee_option_as_string( libvlc_media_player_t *p_mi,
-                                                  unsigned option,
+                                                  libvlc_video_marquee_string_option_t option,
                                                   libvlc_exception_t *p_e )
 {
     const char * identifier = get_marquee_string_option_identifier(option);
@@ -742,7 +740,7 @@ char * libvlc_video_get_marquee_option_as_string( libvlc_media_player_t *p_mi,
  * libvlc_video_set_marquee_option_as_int: enable, disable or set an int option
  *****************************************************************************/
 void libvlc_video_set_marquee_option_as_int( libvlc_media_player_t *p_mi,
-                                             unsigned option,
+                                          libvlc_video_marquee_int_option_t option,
                                           int value, libvlc_exception_t *p_e )
 {
     const char * identifier = get_marquee_int_option_identifier(option);
@@ -785,7 +783,7 @@ void libvlc_video_set_marquee_option_as_int( libvlc_media_player_t *p_mi,
  * libvlc_video_set_marquee_option_as_string: set a string option
  *****************************************************************************/
 void libvlc_video_set_marquee_option_as_string( libvlc_media_player_t *p_mi,
-                                                unsigned option,
+                                             libvlc_video_marquee_string_option_t option,
                                              const char * value,
                                              libvlc_exception_t *p_e )
 {