Commit 1f02e8c0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

visual: do not keep unused fields

parent 3c4189bc
...@@ -175,9 +175,6 @@ struct filter_sys_t ...@@ -175,9 +175,6 @@ struct filter_sys_t
{ {
vout_thread_t* p_vout; vout_thread_t* p_vout;
int i_width;
int i_height;
int i_effect; int i_effect;
visual_effect_t **effect; visual_effect_t **effect;
}; };
...@@ -191,21 +188,20 @@ static int Open( vlc_object_t *p_this ) ...@@ -191,21 +188,20 @@ static int Open( vlc_object_t *p_this )
filter_sys_t *p_sys; filter_sys_t *p_sys;
char *psz_effects, *psz_parser; char *psz_effects, *psz_parser;
video_format_t fmt;
p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) ); p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
if( unlikely (p_sys == NULL ) ) if( unlikely (p_sys == NULL ) )
return VLC_EGENERIC; return VLC_EGENERIC;
p_sys->i_height = var_InheritInteger( p_filter , "effect-height"); int width = var_InheritInteger( p_filter , "effect-width");
p_sys->i_width = var_InheritInteger( p_filter , "effect-width"); int height = var_InheritInteger( p_filter , "effect-width");
/* No resolution under 400x532 and no odd dimension */
/* No resolution under 400x532 */ if( width < 532 )
if( p_sys->i_height < 400 ) p_sys->i_height = 400; width = 532;
if( p_sys->i_width < 532 ) p_sys->i_width = 532; width &= ~1;
/* Work on even dimensions */ if( height < 400 )
if( (p_sys->i_height % 2 ) != 0 ) p_sys->i_height--; height = 400;
if( (p_sys->i_width % 2 ) != 0 ) p_sys->i_width--; height &= ~1;
p_sys->i_effect = 0; p_sys->i_effect = 0;
p_sys->effect = NULL; p_sys->effect = NULL;
...@@ -220,8 +216,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -220,8 +216,8 @@ static int Open( vlc_object_t *p_this )
p_effect = malloc( sizeof( visual_effect_t ) ); p_effect = malloc( sizeof( visual_effect_t ) );
if( !p_effect ) if( !p_effect )
break; break;
p_effect->i_width = p_sys->i_width; p_effect->i_width = width;
p_effect->i_height = p_sys->i_height; p_effect->i_height = height;
p_effect->i_nb_chans = aout_FormatNbChannels( &p_filter->fmt_in.audio); p_effect->i_nb_chans = aout_FormatNbChannels( &p_filter->fmt_in.audio);
p_effect->i_idx_left = 0; p_effect->i_idx_left = 0;
p_effect->i_idx_right = __MIN( 1, p_effect->i_nb_chans-1 ); p_effect->i_idx_right = __MIN( 1, p_effect->i_nb_chans-1 );
...@@ -295,13 +291,15 @@ static int Open( vlc_object_t *p_this ) ...@@ -295,13 +291,15 @@ static int Open( vlc_object_t *p_this )
} }
/* Open the video output */ /* Open the video output */
memset( &fmt, 0, sizeof(video_format_t) ); video_format_t fmt = {
.i_chroma = VLC_CODEC_I420,
fmt.i_width = fmt.i_visible_width = p_sys->i_width; .i_width = width,
fmt.i_height = fmt.i_visible_height = p_sys->i_height; .i_height = height,
fmt.i_chroma = VLC_CODEC_I420; .i_visible_width = width,
fmt.i_sar_num = fmt.i_sar_den = 1; .i_visible_height = height,
.i_sar_num = 1,
.i_sar_den = 1,
};
p_sys->p_vout = aout_filter_RequestVout( p_filter, NULL, &fmt ); p_sys->p_vout = aout_filter_RequestVout( p_filter, NULL, &fmt );
if( p_sys->p_vout == NULL ) if( p_sys->p_vout == NULL )
{ {
......
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