Skip to content
Snippets Groups Projects
Commit 849635ac authored by Johannes Kauffmann's avatar Johannes Kauffmann Committed by Steve Lhomme
Browse files

opencv_wrapper: scope psz_inner_name locally

psz_inner_name was only used in Create(), thus move it out of
filter_sys_t struct. This also moves the free() closer to where the
variable is allocated.
parent 8d5dfed5
No related branches found
No related tags found
1 merge request!4802opencv_wrapper/libaribcaption: scope structure members locally
......@@ -131,7 +131,6 @@ typedef struct
IplImage *p_cv_image[VOUT_MAX_PLANES];
filter_t *p_opencv;
char* psz_inner_name;
picture_t hacked_pic;
} filter_sys_t;
......@@ -166,18 +165,18 @@ static int Create( filter_t* p_filter )
return VLC_ENOMEM;
}
p_sys->psz_inner_name = var_InheritString( p_filter, "opencv-filter-name" );
if( p_sys->psz_inner_name )
char *psz_inner_name = var_InheritString( p_filter, "opencv-filter-name" );
if( psz_inner_name )
p_sys->p_opencv->p_module =
module_need( p_sys->p_opencv,
"opencv internal filter",
p_sys->psz_inner_name,
psz_inner_name,
true );
if( !p_sys->p_opencv->p_module )
{
msg_Err( p_filter, "can't open internal opencv filter: %s", p_sys->psz_inner_name );
free( p_sys->psz_inner_name );
msg_Err( p_filter, "can't open internal opencv filter: %s", psz_inner_name );
free( psz_inner_name );
vlc_object_delete(p_sys->p_opencv);
free( p_sys );
......@@ -239,7 +238,8 @@ static int Create( filter_t* p_filter )
p_sys->f_scale,
p_sys->i_internal_chroma,
p_sys->i_wrapper_output,
p_sys->psz_inner_name);
psz_inner_name);
free( psz_inner_name );
#ifndef NDEBUG
msg_Dbg( p_filter, "opencv_wrapper successfully started" );
......@@ -265,8 +265,6 @@ static void Destroy( filter_t* p_filter )
filter_sys_t *p_sys = p_filter->p_sys;
ReleaseImages( p_filter );
free( p_sys->psz_inner_name );
// Release the internal OpenCV filter.
filter_Close( p_sys->p_opencv );
module_unneed( p_sys->p_opencv, p_sys->p_opencv->p_module );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment