Commit 7c8c88f6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- fix input memleak

- move vlm to input/
- remove unused libvlc export
parent 6aabccec
...@@ -322,7 +322,7 @@ SOURCES_libvlc_common = \ ...@@ -322,7 +322,7 @@ SOURCES_libvlc_common = \
misc/variables.c \ misc/variables.c \
misc/error.c \ misc/error.c \
misc/update.c \ misc/update.c \
misc/vlm.c \ input/vlm.c \
misc/xml.c \ misc/xml.c \
misc/dict.c \ misc/dict.c \
misc/devices.c \ misc/devices.c \
......
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
static int Run ( input_thread_t *p_input ); static int Run ( input_thread_t *p_input );
static int RunAndClean ( input_thread_t *p_input ); static int RunAndClean ( input_thread_t *p_input );
static input_thread_t * Create ( vlc_object_t *, input_item_t *, char *, static input_thread_t * Create ( vlc_object_t *, input_item_t *,
vlc_bool_t ); const char *, vlc_bool_t );
static int Init ( input_thread_t *p_input ); static int Init ( input_thread_t *p_input );
static void Error ( input_thread_t *p_input ); static void Error ( input_thread_t *p_input );
static void End ( input_thread_t *p_input ); static void End ( input_thread_t *p_input );
...@@ -105,7 +105,7 @@ static void InputMetaUser( input_thread_t *p_input ); ...@@ -105,7 +105,7 @@ static void InputMetaUser( input_thread_t *p_input );
* TODO complete this list (?) * TODO complete this list (?)
*****************************************************************************/ *****************************************************************************/
static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
char *psz_header, vlc_bool_t b_quick ) const char *psz_header, vlc_bool_t b_quick )
{ {
input_thread_t *p_input = NULL; /* thread descriptor */ input_thread_t *p_input = NULL; /* thread descriptor */
vlc_value_t val; vlc_value_t val;
...@@ -272,7 +272,7 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent, ...@@ -272,7 +272,7 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
/* Gruik ! */ /* Gruik ! */
input_thread_t *__input_CreateThread2( vlc_object_t *p_parent, input_thread_t *__input_CreateThread2( vlc_object_t *p_parent,
input_item_t *p_item, input_item_t *p_item,
char *psz_header ) const char *psz_header )
{ {
input_thread_t *p_input = NULL; /* thread descriptor */ input_thread_t *p_input = NULL; /* thread descriptor */
...@@ -290,6 +290,7 @@ input_thread_t *__input_CreateThread2( vlc_object_t *p_parent, ...@@ -290,6 +290,7 @@ input_thread_t *__input_CreateThread2( vlc_object_t *p_parent,
input_ChangeState( p_input, ERROR_S ); input_ChangeState( p_input, ERROR_S );
msg_Err( p_input, "cannot create input thread" ); msg_Err( p_input, "cannot create input thread" );
vlc_object_detach( p_input ); vlc_object_detach( p_input );
free( p_input->p );
vlc_object_destroy( p_input ); vlc_object_destroy( p_input );
return NULL; return NULL;
} }
...@@ -331,6 +332,7 @@ int __input_Read( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -331,6 +332,7 @@ int __input_Read( vlc_object_t *p_parent, input_item_t *p_item,
input_ChangeState( p_input, ERROR_S ); input_ChangeState( p_input, ERROR_S );
msg_Err( p_input, "cannot create input thread" ); msg_Err( p_input, "cannot create input thread" );
vlc_object_detach( p_input ); vlc_object_detach( p_input );
free( p_input->p );
vlc_object_destroy( p_input ); vlc_object_destroy( p_input );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -370,6 +372,7 @@ int __input_Preparse( vlc_object_t *p_parent, input_item_t *p_item ) ...@@ -370,6 +372,7 @@ int __input_Preparse( vlc_object_t *p_parent, input_item_t *p_item )
if( p_input->p->p_es_out ) input_EsOutDelete( p_input->p->p_es_out ); if( p_input->p->p_es_out ) input_EsOutDelete( p_input->p->p_es_out );
vlc_object_detach( p_input ); vlc_object_detach( p_input );
free( p_input->p );
vlc_object_destroy( p_input ); vlc_object_destroy( p_input );
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -532,6 +535,7 @@ static int RunAndClean( input_thread_t *p_input ) ...@@ -532,6 +535,7 @@ static int RunAndClean( input_thread_t *p_input )
/* Release memory */ /* Release memory */
vlc_object_detach( p_input ); vlc_object_detach( p_input );
free( p_input->p );
vlc_object_destroy( p_input ); vlc_object_destroy( p_input );
return 0; return 0;
......
...@@ -224,6 +224,10 @@ int input_DownloadAndCacheArt ( playlist_t *, input_item_t * ); ...@@ -224,6 +224,10 @@ int input_DownloadAndCacheArt ( playlist_t *, input_item_t * );
* Internal prototypes * Internal prototypes
***************************************************************************/ ***************************************************************************/
/* input.c */
#define input_CreateThread2(a,b,c) __input_CreateThread2(VLC_OBJECT(a),b,c)
input_thread_t *__input_CreateThread2 ( vlc_object_t *, input_item_t *, const char * );
/* var.c */ /* var.c */
void input_ControlVarInit ( input_thread_t * ); void input_ControlVarInit ( input_thread_t * );
void input_ControlVarClean( input_thread_t * ); void input_ControlVarClean( input_thread_t * );
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#endif #endif
#include <vlc_input.h> #include <vlc_input.h>
#include "input_internal.h"
#include <vlc_stream.h> #include <vlc_stream.h>
#include <vlc_vlm.h> #include <vlc_vlm.h>
#include <vlc_vod.h> #include <vlc_vod.h>
......
...@@ -1456,7 +1456,7 @@ static void CloseModule( module_handle_t handle ) ...@@ -1456,7 +1456,7 @@ static void CloseModule( module_handle_t handle )
FreeLibrary( handle ); FreeLibrary( handle );
#elif defined(HAVE_DL_DLOPEN) #elif defined(HAVE_DL_DLOPEN)
dlclose( handle ); //dlclose( handle );
#elif defined(HAVE_DL_SHL_LOAD) #elif defined(HAVE_DL_SHL_LOAD)
shl_unload( handle ); shl_unload( handle );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment