changeset 318:eb5d48fcf8ea trunk

[svn] - use blargg's fix instead
author nenolod
date Thu, 30 Nov 2006 20:20:30 -0800
parents 3b3887985a5c
children 687f74f92f6d
files ChangeLog src/console/Fir_Resampler.cxx src/console/Spc_Emu.cxx
diffstat 3 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Nov 30 20:18:38 2006 -0800
+++ b/ChangeLog	Thu Nov 30 20:20:30 2006 -0800
@@ -1,3 +1,11 @@
+2006-12-01 04:18:38 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [698]
+  - if buf.size() == 0, bail
+  
+  trunk/src/console/Fir_Resampler.cxx |    4 ++++
+  1 file changed, 4 insertions(+)
+
+
 2006-12-01 03:54:33 +0000  William Pitcock <nenolod@nenolod.net>
   revision [692]
   - merge libconsole-blargg into mainline libconsole:
--- a/src/console/Fir_Resampler.cxx	Thu Nov 30 20:18:38 2006 -0800
+++ b/src/console/Fir_Resampler.cxx	Thu Nov 30 20:20:30 2006 -0800
@@ -191,10 +191,6 @@
 	if ( count > avail )
 		count = avail;
 
-	/* if the resampler is not used, then bail --nenolod */
-	if ( buf.size() == 0 )
-		return count;
-	
 	remain -= count;
 	write_pos = &buf [remain];
 	memmove( buf.begin(), &buf [count], remain * sizeof buf [0] );
--- a/src/console/Spc_Emu.cxx	Thu Nov 30 20:18:38 2006 -0800
+++ b/src/console/Spc_Emu.cxx	Thu Nov 30 20:20:30 2006 -0800
@@ -287,9 +287,12 @@
 
 blargg_err_t Spc_Emu::skip_( long count )
 {
-	count = long (count * resampler.ratio()) & ~1;
-	
-	count -= resampler.skip_input( count );
+	if ( sample_rate() != native_sample_rate )
+	{
+		count = long (count * resampler.ratio()) & ~1;
+		count -= resampler.skip_input( count );
+	} 
+
 	if ( count > 0 )
 		RETURN_ERR( apu.skip( count ) );