[vlc-commits] gain: setup filter_t only when successful
Rémi Denis-Courmont
git at videolan.org
Tue Nov 6 18:39:29 CET 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 6 19:36:48 2012 +0200| [f2ce1cab3e00cca4e136ca125f845beb8fdd10a4] | committer: Rémi Denis-Courmont
gain: setup filter_t only when successful
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f2ce1cab3e00cca4e136ca125f845beb8fdd10a4
---
modules/audio_filter/gain.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/modules/audio_filter/gain.c b/modules/audio_filter/gain.c
index 68e689a..ead530f 100644
--- a/modules/audio_filter/gain.c
+++ b/modules/audio_filter/gain.c
@@ -79,15 +79,7 @@ vlc_module_end()
static int Open( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
- filter_sys_t *p_sys;
-
- if ( !AOUT_FMTS_IDENTICAL( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )
- {
- msg_Warn( p_filter, "bad input or output format" );
- return VLC_EGENERIC;
- }
-
- p_sys = vlc_object_create( p_this, sizeof( *p_sys ) );
+ filter_sys_t *p_sys = vlc_object_create( p_this, sizeof( *p_sys ) );
if( unlikely( p_sys == NULL ) )
return VLC_ENOMEM;
@@ -104,6 +96,7 @@ static int Open( vlc_object_t *p_this )
p_sys->f_gain = var_InheritFloat( p_filter->p_parent, "gain-value" );
msg_Dbg( p_filter, "gain multiplier sets to %.2fx", p_sys->f_gain );
+ p_filter->fmt_out.audio = p_filter->fmt_in.audio;
p_filter->pf_audio_filter = Process;
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list