Skip to content

Commit 071b109

Browse files
committed
AudioPlayer: add resizeCopier()
1 parent 1edc499 commit 071b109

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/AudioTools/CoreAudio/AudioPlayer.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,12 @@ class AudioPlayer : public AudioInfoSupport, public VolumeSupport {
355355
/// Defines the wait time in ms if the target output is full
356356
virtual void setDelayIfOutputFull(int delayMs) { delay_if_full = delayMs; }
357357

358+
/// Copies DEFAULT_BUFFER_SIZE (=1024 bytes) from the source to the decoder: Call this method in the loop.
358359
virtual size_t copy() {
359360
return copy(copier.bufferSize());
360361
}
361362

362-
/// Call this method in the loop.
363+
/// Copies the indicated number of bytes from the source to the decoder: Call this method in the loop.
363364
virtual size_t copy(size_t bytes) {
364365
size_t result = 0;
365366
if (active) {
@@ -456,6 +457,11 @@ class AudioPlayer : public AudioInfoSupport, public VolumeSupport {
456457
meta_out.resize(size);
457458
}
458459

460+
/// Redefines the default copy size
461+
void resizeCopier(int size){
462+
copier.resize(size);
463+
}
464+
459465
protected:
460466
bool active = false;
461467
bool autonext = true;

0 commit comments

Comments
 (0)