Don't leak vlc_bool_t through libvlc-control
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 17 Mar 2008 19:20:33 +0000 (21:20 +0200)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 17 Mar 2008 19:20:33 +0000 (21:20 +0200)
This restores the ABI. It also avoids nasty issues with determining
what a native boolean is from language bindings.

include/vlc/libvlc.h
src/control/audio.c
src/control/media_descriptor.c
src/control/media_discoverer.c
src/control/media_instance.c
src/control/media_list.c
src/control/media_list_player.c
src/control/playlist.c
src/control/tag_query.c
src/control/video.c

index c96b407..88ecc4a 100644 (file)
@@ -236,7 +236,7 @@ VLC_PUBLIC_API libvlc_time_t
    libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
                                          libvlc_exception_t * p_e );
 
-VLC_PUBLIC_API vlc_bool_t
+VLC_PUBLIC_API int
    libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
                                          libvlc_exception_t * p_e );
 
@@ -262,7 +262,7 @@ VLC_PUBLIC_API void *
 /**
  * Set loop variable
  */
-VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
+VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , int,
                                           libvlc_exception_t * );
 
 /**
@@ -384,11 +384,11 @@ VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
                                 libvlc_instance_t *, libvlc_exception_t * );
 
-VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_is_seekable(
+VLC_PUBLIC_API int libvlc_media_instance_is_seekable(
                                  libvlc_media_instance_t *p_mi,
                                  libvlc_exception_t *p_e );
 
-VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_can_pause(
+VLC_PUBLIC_API int libvlc_media_instance_can_pause(
                                  libvlc_media_instance_t *p_mi,
                                  libvlc_exception_t *p_e );
 
@@ -457,7 +457,7 @@ VLC_PUBLIC_API void          libvlc_media_instance_set_position   ( libvlc_media
 VLC_PUBLIC_API void          libvlc_media_instance_set_chapter    ( libvlc_media_instance_t *, int, libvlc_exception_t *);
 VLC_PUBLIC_API int           libvlc_media_instance_get_chapter    (libvlc_media_instance_t *, libvlc_exception_t *);
 VLC_PUBLIC_API int           libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API vlc_bool_t    libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API int    libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
 VLC_PUBLIC_API float         libvlc_media_instance_get_rate       ( libvlc_media_instance_t *, libvlc_exception_t *);
 VLC_PUBLIC_API void          libvlc_media_instance_set_rate       ( libvlc_media_instance_t *, float, libvlc_exception_t *);
 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state   ( libvlc_media_instance_t *, libvlc_exception_t *);
@@ -467,7 +467,7 @@ VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state   ( libvlc_media_i
  * \param p_input the input
  * \param p_exception an initialized exception
  */
-VLC_PUBLIC_API vlc_bool_t  libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API int  libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
 VLC_PUBLIC_API float       libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
 
 
@@ -496,7 +496,7 @@ VLC_PUBLIC_API void
                                             char * psz_tag_key,
                                             libvlc_exception_t * );
 
-VLC_PUBLIC_API vlc_bool_t
+VLC_PUBLIC_API int
     libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
                             libvlc_exception_t * );
 
@@ -559,7 +559,7 @@ VLC_PUBLIC_API int
                                      libvlc_exception_t * );
 
 /* This indicates if this media list is read-only from a user point of view */
-VLC_PUBLIC_API vlc_bool_t
+VLC_PUBLIC_API int
     libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist );
 
 VLC_PUBLIC_API void
@@ -740,7 +740,7 @@ VLC_PUBLIC_API void
     libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
                                    libvlc_exception_t * p_e );
 
-VLC_PUBLIC_API vlc_bool_t
+VLC_PUBLIC_API int
     libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
                                          libvlc_exception_t * p_e );
 
@@ -986,7 +986,7 @@ VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_except
  * \param p_exception an initialized exception
  * \return the mute status (boolean)
  */
-VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
 
 /**
  * Set mute status
@@ -995,7 +995,7 @@ VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exc
  * \param p_exception an initialized exception
  * \return void
  */
-VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
 
 /**
  * Get current audio level
@@ -1076,7 +1076,7 @@ VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_
 VLC_PUBLIC_API libvlc_event_manager_t *
         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
 
-VLC_PUBLIC_API vlc_bool_t
+VLC_PUBLIC_API int
         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
 
 /**@} */
index d6be7a6..3744d78 100644 (file)
@@ -60,8 +60,8 @@ void libvlc_audio_toggle_mute( libvlc_instance_t *p_instance,
     aout_VolumeMute( p_instance->p_libvlc_int, NULL );
 }
 
-vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *p_instance,
-                                  libvlc_exception_t *p_e )
+int libvlc_audio_get_mute( libvlc_instance_t *p_instance,
+                           libvlc_exception_t *p_e )
 {
     /*
      * If the volume level is 0, then the channel is muted
@@ -74,7 +74,7 @@ vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *p_instance,
     return VLC_FALSE;
 }
 
-void libvlc_audio_set_mute( libvlc_instance_t *p_instance, vlc_bool_t mute,
+void libvlc_audio_set_mute( libvlc_instance_t *p_instance, int mute,
                             libvlc_exception_t *p_e )
 {
     if ( mute ^ libvlc_audio_get_mute( p_instance, p_e ) )
index 3dee389..3ba789b 100644 (file)
@@ -655,7 +655,7 @@ libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
 /**************************************************************************
  * Get preparsed status for media_descriptor object.
  **************************************************************************/
-vlc_bool_t
+int
 libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
                                        libvlc_exception_t * p_e )
 {
index 527626b..0a1d1a2 100644 (file)
@@ -264,7 +264,7 @@ libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis )
 /**************************************************************************
  * running (Public)
  **************************************************************************/
-vlc_bool_t
+int
 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis )
 {
     return p_mdis->running;
index e7dc33d..c11d733 100644 (file)
@@ -836,9 +836,8 @@ float libvlc_media_instance_get_fps(
     return f_fps;
 }
 
-vlc_bool_t libvlc_media_instance_will_play(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e)
+int libvlc_media_instance_will_play( libvlc_media_instance_t *p_mi,
+                                     libvlc_exception_t *p_e)
 {
     input_thread_t *p_input_thread =
                             libvlc_get_input_thread ( p_mi, p_e);
@@ -914,9 +913,8 @@ libvlc_state_t libvlc_media_instance_get_state(
     return vlc_to_libvlc_state(val.i_int);
 }
 
-vlc_bool_t libvlc_media_instance_is_seekable(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
+int libvlc_media_instance_is_seekable( libvlc_media_instance_t *p_mi,
+                                       libvlc_exception_t *p_e )
 {
     input_thread_t *p_input_thread;
     vlc_value_t val;
@@ -935,9 +933,8 @@ vlc_bool_t libvlc_media_instance_is_seekable(
     return val.b_bool;
 }
 
-vlc_bool_t libvlc_media_instance_can_pause(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
+int libvlc_media_instance_can_pause( libvlc_media_instance_t *p_mi,
+                                     libvlc_exception_t *p_e )
 {
     input_thread_t *p_input_thread;
     vlc_value_t val;
index ae5a72a..a88ed8c 100644 (file)
@@ -456,7 +456,7 @@ int libvlc_media_list_index_of_item( libvlc_media_list_t * p_mlist,
  *
  * This indicates if this media list is read-only from a user point of view
  **************************************************************************/
-vlc_bool_t libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist )
+int libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist )
 {
     return p_mlist->b_read_only;
 }
index 1d1167a..75b467b 100644 (file)
@@ -342,7 +342,7 @@ void libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
 /**************************************************************************
  *        is_playing (Public)
  **************************************************************************/
-vlc_bool_t
+int
 libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
                                      libvlc_exception_t * p_e )
 {
index 7ab5063..74af3f5 100644 (file)
@@ -49,7 +49,7 @@ static inline void playlist_mark_locked( libvlc_instance_t *p_instance,
     vlc_mutex_unlock( &p_instance->instance_lock );
 }
 
-void libvlc_playlist_loop( libvlc_instance_t *p_instance, vlc_bool_t loop,
+void libvlc_playlist_loop( libvlc_instance_t *p_instance, int loop,
                            libvlc_exception_t *p_e)
 {
     VLC_UNUSED(p_e);
index 5b49539..d1497bc 100644 (file)
@@ -109,7 +109,7 @@ void libvlc_tag_query_set_match_tag_and_key( libvlc_tag_query_t * p_q,
  *
  * Return true if the query p_q is matched in p_md
  **************************************************************************/
-vlc_bool_t
+int
 libvlc_tag_query_match( libvlc_tag_query_t * p_q,
                         libvlc_media_descriptor_t * p_md,
                         libvlc_exception_t * p_e )
index 4ba2d3d..4ebb4e6 100644 (file)
@@ -186,8 +186,8 @@ int libvlc_video_get_width( libvlc_media_instance_t *p_mi,
     return p_vout1->i_window_width;
 }
 
-vlc_bool_t libvlc_media_instance_has_vout( libvlc_media_instance_t *p_mi,
-                                  libvlc_exception_t *p_e )
+int libvlc_media_instance_has_vout( libvlc_media_instance_t *p_mi,
+                                     libvlc_exception_t *p_e )
 {
     input_thread_t *p_input_thread = libvlc_get_input_thread(p_mi, p_e);
     vlc_bool_t has_vout = VLC_FALSE;