]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/equalizer.c
FSF address change.
[vlc] / modules / audio_filter / equalizer.c
index 0bfc27cb47e12477aff54889799527473d90afea..13e62c7293b44b3247563548a5dfb7e8bb9de567 100644 (file)
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -136,16 +136,26 @@ static int Open( vlc_object_t *p_this )
 {
     aout_filter_t     *p_filter = (aout_filter_t *)p_this;
     aout_filter_sys_t *p_sys;
+    vlc_bool_t         b_fit = VLC_TRUE;
 
     if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
         p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
     {
+        b_fit = VLC_FALSE;
+        p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
         msg_Warn( p_filter, "Bad input or output format" );
-        return VLC_EGENERIC;
     }
     if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
     {
+        b_fit = VLC_FALSE;
+        memcpy( &p_filter->output, &p_filter->input,
+                sizeof(audio_sample_format_t) );
         msg_Warn( p_filter, "input and output formats are not similar" );
+    }
+
+    if ( ! b_fit )
+    {
         return VLC_EGENERIC;
     }
 
@@ -349,7 +359,8 @@ static int EqzInit( aout_filter_t *p_filter, int i_rate )
         strstr( p_sys->psz_newbands, val2.psz_string ) ) || !*val2.psz_string )
     {
         var_SetString( p_aout, "equalizer-bands", p_sys->psz_newbands );
-        var_SetFloat( p_aout, "equalizer-preamp", p_sys->f_newpreamp );
+        if( p_sys->f_newpreamp == p_sys->f_gamp )
+            var_SetFloat( p_aout, "equalizer-preamp", p_sys->f_newpreamp );
     }
 
     /* Add our own callbacks */