@@ -435,10 +435,8 @@ AudioPort::handleBufferUnderflow()
435435    // 
436436    //  (1) The consumer runs slightly faster than the producer
437437    //  (2) The producer is halted or not startet yet
438-     
439-     //  debug(AUDBUF_DEBUG, "UNDERFLOW (r: %ld w: %ld)\n", stream.r, stream.w);
440438
441-     //  Reset  the write pointer
439+     //  Wipe out the buffer and reset  the write pointer
442440    stream.clear (SamplePair{0 ,0 });
443441    stream.alignWritePtr ();
444442
@@ -466,8 +464,6 @@ AudioPort::handleBufferOverflow()
466464    //  (1) The consumer runs slightly slower than the producer
467465    //  (2) The consumer is halted or not startet yet
468466
469-     //  debug(AUDBUF_DEBUG, "OVERFLOW (r: %ld w: %ld)\n", stream.r, stream.w);
470- 
471467    //  Reset the write pointer
472468    stream.alignWritePtr ();
473469
@@ -507,13 +503,13 @@ AudioPort::copyMono(float *buffer, isize n)
507503}
508504
509505isize
510- AudioPort::copyStereo (float  *buffer1 , float  *buffer2 , isize n)
506+ AudioPort::copyStereo (float  *left , float  *right , isize n)
511507{
512508    //  Inform the sample rate detector about the number of requested samples
513509    detector.feed (n);
514510
515511    //  Copy sound samples
516-     auto  cnt = stream.copyStereo (buffer1, buffer2 , n);
512+     auto  cnt = stream.copyStereo (left, right , n);
517513    stats.consumedSamples  += cnt;
518514
519515    //  Check for a buffer underflow
0 commit comments