]> git.sesse.net Git - vlc/commitdiff
Added input_Close() helper.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 22 May 2011 19:49:14 +0000 (21:49 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 22 May 2011 20:35:59 +0000 (22:35 +0200)
include/vlc_input.h
src/input/input.c
src/libvlccore.sym

index 7b052e9ebfb3decf4615d3330bb04fd3604accf2..455241a41ec763cd33c5db5613b9ed12dc0acef2 100644 (file)
@@ -543,6 +543,8 @@ VLC_API int input_vaControl( input_thread_t *, int i_query, va_list  );
 
 VLC_API int input_Control( input_thread_t *, int i_query, ...  );
 
+VLC_API int input_Close( input_thread_t * );
+
 /**
  * Get the input item for an input thread
  *
index 63a148029d21448996035d65d0fa8ac81deb1ba4..cfbe3cc1a634e8eab35902b7da535e4c2c54a4a9 100644 (file)
@@ -250,6 +250,17 @@ void input_Stop( input_thread_t *p_input, bool b_abort )
     input_ControlPush( p_input, INPUT_CONTROL_SET_DIE, NULL );
 }
 
+/**
+ * Close an input
+ *
+ * It does not call input_Stop itself.
+ */
+int input_Close( input_thread_t *p_input )
+{
+    vlc_thread_join( p_input );
+    vlc_object_release( p_input );
+}
+
 /**
  * Get the item from an input thread
  * FIXME it does not increase ref count of the item.
index 896153737b43e1aadf33eeb207255f1bf89804f2..b53b0a08212da77feef8d81d9e1b0b1b3dc3fc0d 100644 (file)
@@ -226,6 +226,7 @@ input_SplitMRL
 input_Start
 input_Stop
 input_vaControl
+input_Close
 intf_Create
 intf_Eject
 IsUTF8