[vlc-devel] commit: Fix a memleak and threaded function definition. ( Rémi Duraffort )

git version control git at videolan.org
Sun Aug 3 20:15:01 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Aug  3 20:17:19 2008 +0200| [65126a7e8c5f5d29e81118f29e0f5de22a6823af] | committer: Rémi Duraffort 

Fix a memleak and threaded function definition.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=65126a7e8c5f5d29e81118f29e0f5de22a6823af
---

 src/video_output/video_output.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 3511ccb..40ac255 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -63,7 +63,7 @@
  * Local prototypes
  *****************************************************************************/
 static int      InitThread        ( vout_thread_t * );
-static void     RunThread         ( vout_thread_t * );
+static void*    RunThread         ( vlc_object_t *  );
 static void     ErrorThread       ( vout_thread_t * );
 static void     CleanThread       ( vout_thread_t * );
 static void     EndThread         ( vout_thread_t * );
@@ -366,8 +366,9 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     }
 
     /* Create the vout thread */
-    config_ChainCreate( &psz_name, &p_cfg, psz_parser );
+    char* psz_tmp = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
     free( psz_parser );
+    free( psz_tmp );
     p_vout->p_cfg = p_cfg;
     p_vout->p_module = module_Need( p_vout,
         ( p_vout->psz_filter_chain && *p_vout->psz_filter_chain ) ?
@@ -696,8 +697,9 @@ static int InitThread( vout_thread_t *p_vout )
  * terminated. It handles the pictures arriving in the video heap and the
  * display device events.
  *****************************************************************************/
-static void RunThread( vout_thread_t *p_vout)
+static void* RunThread( vlc_object_t *p_this )
 {
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
     int             i_index;                                /* index in heap */
     int             i_idle_loops = 0;  /* loops without displaying a picture */
     mtime_t         current_date;                            /* current date */
@@ -1389,8 +1391,9 @@ typedef struct suxor_thread_t
 
 } suxor_thread_t;
 
-static void SuxorRestartVideoES( suxor_thread_t *p_this )
+static void* SuxorRestartVideoES( vlc_object_t * p_vlc_t )
 {
+    suxor_thread_t *p_this = (suxor_thread_t *) p_vlc_t;
     /* Now restart current video stream */
     int val = var_GetInteger( p_this->p_input, "video-es" );
     if( val >= 0 )




More information about the vlc-devel mailing list