From 8e7e0dfdbb187ae3b44d7e115b240a105dfa2a72 Mon Sep 17 00:00:00 2001 From: darkeye Date: Sat, 3 Aug 2002 10:30:46 +0000 Subject: [PATCH] resampling bugs fixed for vorbis streams --- darkice/trunk/ChangeLog | 4 ++++ darkice/trunk/src/VorbisLibEncoder.cpp | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/darkice/trunk/ChangeLog b/darkice/trunk/ChangeLog index 6d51ecf..549ed39 100644 --- a/darkice/trunk/ChangeLog +++ b/darkice/trunk/ChangeLog @@ -1,3 +1,7 @@ +DarkIce next version + + o bug fix: resampling audio for vorbis streams bugs fixed + 02-08-2002: DarkIce 0.10.1 released o bug fix: when the last server dropped connection, darkice crashed diff --git a/darkice/trunk/src/VorbisLibEncoder.cpp b/darkice/trunk/src/VorbisLibEncoder.cpp index c6fd28a..ede879c 100644 --- a/darkice/trunk/src/VorbisLibEncoder.cpp +++ b/darkice/trunk/src/VorbisLibEncoder.cpp @@ -205,7 +205,7 @@ VorbisLibEncoder :: write ( const void * buf, if ( converter ) { // resample if needed - int inCount = totalSamples; + int inCount = nSamples; int outCount = (int) (inCount * resampleRatio); short int * resampledBuffer = new short int[outCount * channels]; int converted; @@ -216,11 +216,14 @@ VorbisLibEncoder :: write ( const void * buf, resampledBuffer ); vorbisBuffer = vorbis_analysis_buffer( &vorbisDspState, - converted / channels); - Util::conv( resampledBuffer, converted, vorbisBuffer, channels); + converted); + Util::conv( resampledBuffer, + converted * channels, + vorbisBuffer, + channels); delete[] resampledBuffer; - vorbis_analysis_wrote( &vorbisDspState, converted / channels); + vorbis_analysis_wrote( &vorbisDspState, converted); } else { @@ -316,6 +319,9 @@ VorbisLibEncoder :: close ( void ) throw ( Exception ) $Source$ $Log$ + Revision 1.12 2002/08/03 10:30:46 darkeye + resampling bugs fixed for vorbis streams + Revision 1.11 2002/07/20 16:37:06 darkeye added fault tolerance in case a server connection is dropped