bug fix for an old bug in BufferedSink.cpp

This commit is contained in:
rafael@riseup.net 2010-05-06 20:19:18 +00:00
parent 9bca6850a7
commit ccd4d54df8
3 changed files with 14 additions and 4 deletions

View File

@ -41,3 +41,4 @@ with contributions by:
Roland Hermans <roland.hermans@omroepvenray.nl>
Sergiy <piratfm@gmail.com>
Clemens Ladisch <clemens@ladisch.de>
Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>

View File

@ -1,14 +1,18 @@
Next release
o fixed a bug in BufferedSink.cpp that leads to some buffers
being written twice, causing corruption of datastream,
thanks to Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
o implemented samplerate conversion for all codecs using libsamplerate,
and keeping internal aflibConverter as fallback,
thanks to Sergiy <piratfm@gmail.com>
o bugfix: fix for alsa driver - closes ticked #8
thanks to Clemens Ladisch <clemens@ladisch.de>
14-11-2009 Darkice 0.20.1 released
o added rc.darkice init script
thanks to Niels Dettenbach <nd@syndicat.com>
o bugfix: fix for gcc 4.4
05-11-2009 Darkice 0.20 released
o new maintainer: Rafael Diniz <rafael@riseup.net>

View File

@ -330,10 +330,15 @@ BufferedSink :: write ( const void * buf,
// the internal buffer is empty, try to write the fresh data
soFar = 0;
if ( inp != outp ) {
if ( inp == outp ) {
while ( soFar < len && sink->canWrite( 0, 0) ) {
soFar += sink->write( b + soFar, len - soFar);
}
try {
soFar += sink->write( b + soFar, len - soFar);
} catch (Exception &e) {
reportEvent(3,"Exception caught in BufferedSink :: write3\n");
throw; /* up a level */
}
}
}
length = soFar;