r3967 - trunk/bse



Author: stw
Date: 2006-10-12 16:33:39 -0400 (Thu, 12 Oct 2006)
New Revision: 3967

Modified:
   trunk/bse/ChangeLog
   trunk/bse/bsedatahandle-resample.cc
Log:
Thu Oct 12 22:30:46 2006  Stefan Westerfeld  <stefan space twc de>

	* bsedatahandle-resample.cc: Use the newly introduced
	Resampler2::delay().



Modified: trunk/bse/ChangeLog
===================================================================
--- trunk/bse/ChangeLog	2006-10-12 20:13:30 UTC (rev 3966)
+++ trunk/bse/ChangeLog	2006-10-12 20:33:39 UTC (rev 3967)
@@ -1,3 +1,8 @@
+Thu Oct 12 22:30:46 2006  Stefan Westerfeld  <stefan space twc de>
+
+	* bsedatahandle-resample.cc: Use the newly introduced
+	Resampler2::delay().
+
 Thu Oct 12 21:48:54 2006  Stefan Westerfeld  <stefan space twc de>
 
 	* bseresampler.hh:

Modified: trunk/bse/bsedatahandle-resample.cc
===================================================================
--- trunk/bse/bsedatahandle-resample.cc	2006-10-12 20:13:30 UTC (rev 3966)
+++ trunk/bse/bsedatahandle-resample.cc	2006-10-12 20:33:39 UTC (rev 3967)
@@ -176,9 +176,12 @@
 	m_filter_order = resampler->order();
 	
 	g_assert (m_filter_order % 2 == 0);
+	/* Resampler2::delay() is defined in output samples, but we
+	 * compensate by shifting the input samples, thus the factor 2
+	 */
 	m_filter_delay = mode() == BSE_RESAMPLER2_MODE_UPSAMPLE ?
-	                 m_filter_order / 2 + 1 :
-			 m_filter_order + 1;
+	                 (int) round (resampler->delay() / 2) :
+			 (int) round (resampler->delay() * 2);
       }
     return BSE_ERROR_NONE;
   }




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]