Commit fd63550b authored by Gildas Bazin's avatar Gildas Bazin

* modules/stream_out/transcode.c: fixed mem leak + use av_free() instead of free() where necessary.

* modules/codec/ffmpeg/*: use av_free() instead of free() where necessary.
parent 482516c5
...@@ -752,12 +752,12 @@ void E_(CloseEncoder)( vlc_object_t *p_this ) ...@@ -752,12 +752,12 @@ void E_(CloseEncoder)( vlc_object_t *p_this )
vlc_object_destroy( pp_contexts[i] ); vlc_object_destroy( pp_contexts[i] );
} }
free(pp_contexts); free( pp_contexts );
} }
#endif #endif
avcodec_close( p_sys->p_context ); avcodec_close( p_sys->p_context );
free( p_sys->p_context ); av_free( p_sys->p_context );
if( p_sys->p_buffer ) free( p_sys->p_buffer ); if( p_sys->p_buffer ) free( p_sys->p_buffer );
if( p_sys->p_buffer_out ) free( p_sys->p_buffer_out ); if( p_sys->p_buffer_out ) free( p_sys->p_buffer_out );
......
...@@ -214,7 +214,7 @@ static void CloseDecoder( vlc_object_t *p_this ) ...@@ -214,7 +214,7 @@ static void CloseDecoder( vlc_object_t *p_this )
avcodec_close( p_sys->p_context ); avcodec_close( p_sys->p_context );
msg_Dbg( p_dec, "ffmpeg codec (%s) stopped", p_sys->psz_namecodec ); msg_Dbg( p_dec, "ffmpeg codec (%s) stopped", p_sys->psz_namecodec );
free( p_sys->p_context ); av_free( p_sys->p_context );
} }
switch( p_sys->i_cat ) switch( p_sys->i_cat )
......
...@@ -826,11 +826,8 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream, ...@@ -826,11 +826,8 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
static void transcode_audio_ffmpeg_close( sout_stream_t *p_stream, static void transcode_audio_ffmpeg_close( sout_stream_t *p_stream,
sout_stream_id_t *id ) sout_stream_id_t *id )
{ {
if( id->ff_dec ) if( id->ff_dec ) avcodec_close( id->ff_dec_c );
{ av_free( id->ff_dec_c );
avcodec_close( id->ff_dec_c );
free( id->ff_dec_c );
}
module_Unneed( id->p_encoder, id->p_encoder->p_module ); module_Unneed( id->p_encoder, id->p_encoder->p_module );
vlc_object_destroy( id->p_encoder ); vlc_object_destroy( id->p_encoder );
...@@ -1334,11 +1331,8 @@ static void transcode_video_ffmpeg_close ( sout_stream_t *p_stream, ...@@ -1334,11 +1331,8 @@ static void transcode_video_ffmpeg_close ( sout_stream_t *p_stream,
} }
/* Close decoder */ /* Close decoder */
if( id->ff_dec ) if( id->ff_dec ) avcodec_close( id->ff_dec_c );
{ av_free( id->ff_dec_c );
avcodec_close( id->ff_dec_c );
free( id->ff_dec_c );
}
/* Close encoder */ /* Close encoder */
if( id->p_encoder->p_module ) if( id->p_encoder->p_module )
......
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