]> git.sesse.net Git - vlc/commitdiff
libvlc: Vout object now released when needed
authorFilippo Carone <littlejohn@videolan.org>
Mon, 5 Jun 2006 16:00:27 +0000 (16:00 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Mon, 5 Jun 2006 16:00:27 +0000 (16:00 +0000)
src/control/input.c
src/control/video.c

index eb3ebd555fba7881b2f50be2994d735848204551..d2b46b26a11f790d0732b9077eba4e455c13e3b3 100644 (file)
@@ -134,22 +134,12 @@ vlc_bool_t libvlc_input_will_play( libvlc_input_t *p_input,
         return VLC_FALSE;
     }
 
-    if ( !p_input_thread->b_die && !p_input_thread->b_dead )
-        return VLC_TRUE;
-
-    return VLC_FALSE;
-}
-
-vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
-                                  libvlc_exception_t *p_e )
-{
-    vout_thread_t *p_vout = GetVout( p_input, p_e );
-
-    /* GetVout will raise the exception for us */
-    if( !p_vout )
+    if ( !p_input_thread->b_die && !p_input_thread->b_dead ) 
     {
-        return VLC_FALSE;
+        vlc_object_release( p_input_thread );
+        return VLC_TRUE;
     }
-
-    return VLC_TRUE;
+    
+    vlc_object_release( p_input_thread );
+    return VLC_FALSE;
 }
index 4aae65b8efbd69a10c237ece450e2e34a0367ee6..d0bf557152fce4a1ed43b430f1d0d54ecc5e538e 100644 (file)
@@ -27,7 +27,7 @@
 #include <vlc/vout.h>
 #include <vlc/intf.h>
 
-vout_thread_t *GetVout( libvlc_input_t *p_input,
+static vout_thread_t *GetVout( libvlc_input_t *p_input,
                                libvlc_exception_t *p_exception )
 {
     input_thread_t *p_input_thread;
@@ -80,6 +80,9 @@ void libvlc_set_fullscreen( libvlc_input_t *p_input, int b_fullscreen,
     if( i_ret )
         libvlc_exception_raise( p_e,
                         "Unexpected error while setting fullscreen value" );
+
+    vlc_object_release( p_vout1 );
+
 }
 
 int libvlc_get_fullscreen( libvlc_input_t *p_input,
@@ -122,6 +125,9 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input,
     if( i_ret )
         libvlc_exception_raise( p_e,
                         "Unexpected error while setting fullscreen value" );
+
+    vlc_object_release( p_vout1 );
+
 }
 
 void
@@ -182,3 +188,19 @@ int libvlc_video_get_width( libvlc_input_t *p_input,
 
     return p_vout1->i_window_width;
 }
+
+vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
+                                  libvlc_exception_t *p_e )
+{
+    vout_thread_t *p_vout = GetVout( p_input, p_e );
+
+    /* GetVout will raise the exception for us */
+    if( !p_vout )
+    {
+        return VLC_FALSE;
+    }
+
+    vlc_object_release( p_vout );
+    
+    return VLC_TRUE;
+}