]> git.sesse.net Git - vlc/commitdiff
* Fixed a bug triggering the trivial resampler when it was unnecessary.
authorChristophe Massiot <massiot@videolan.org>
Sat, 10 Aug 2002 20:01:00 +0000 (20:01 +0000)
committerChristophe Massiot <massiot@videolan.org>
Sat, 10 Aug 2002 20:01:00 +0000 (20:01 +0000)
modules/audio_filter/resampler/trivial.c

index 59b1c38daf289775bcf21ac1f24bfaa1439fb70b..b96b11446be2452db99955c1e975189cf212e34c 100644 (file)
@@ -2,7 +2,7 @@
  * trivial.c : trivial resampler (skips samples or pads with zeroes)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: trivial.c,v 1.1 2002/08/09 23:47:22 massiot Exp $
+ * $Id: trivial.c,v 1.2 2002/08/10 20:01:00 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -58,6 +58,12 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
+    if ( p_filter->input.i_rate == p_filter->output.i_rate
+          || p_filter->input.i_format != p_filter->output.i_format )
+    {
+        return -1;
+    }
+
     p_filter->pf_do_work = DoWork;
     p_filter->b_in_place = 1;