comparison audio/AudioCallbackPlaySource.cpp @ 562:3c846b06c518 3.0-integration

When returning the frame that we have filled to, avoid accidentally reducing the frame number (making it appear we are less filled than we really are) when we had intended to round it up to the full requested amount. Fixes some unexpected double-playback in non-looping play-selection mode.
author Chris Cannam
date Wed, 14 Dec 2016 11:55:47 +0000
parents 7b115a6505b8
children ce3818cd16c5
comparison
equal deleted inserted replaced
561:fc70aa31d8c5 562:3c846b06c518
1582 #endif 1582 #endif
1583 // We need to maintain full buffers so that the other 1583 // We need to maintain full buffers so that the other
1584 // thread can tell where it's got to in the playback -- so 1584 // thread can tell where it's got to in the playback -- so
1585 // return the full amount here 1585 // return the full amount here
1586 frame = frame + count; 1586 frame = frame + count;
1587 if (frame < nextChunkStart) {
1588 frame = nextChunkStart;
1589 }
1590 #ifdef DEBUG_AUDIO_PLAY_SOURCE
1591 cout << "mixModels: ending at " << nextChunkStart << ", returning frame as "
1592 << frame << endl;
1593 #endif
1587 return count; 1594 return count;
1588 } 1595 }
1589 1596
1590 #ifdef DEBUG_AUDIO_PLAY_SOURCE 1597 #ifdef DEBUG_AUDIO_PLAY_SOURCE
1591 cout << "Selection playback: chunk at " << chunkStart << " -> " << nextChunkStart << " (size " << chunkSize << ")" << endl; 1598 cout << "Selection playback: chunk at " << chunkStart << " -> " << nextChunkStart << " (size " << chunkSize << ")" << endl;