Skip to content

Commit a8a32f1

Browse files
committed
A2DPStream new clear() method
1 parent 826833f commit a8a32f1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/AudioTools/AudioLibs/A2DPStream.h

+9
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,15 @@ class A2DPStream : public AudioStream, public VolumeSupport {
315315
config.silence_on_nodata = silence;
316316
}
317317

318+
/// Clears the buffer
319+
void clear(){
320+
// set inactive if necessary
321+
if (config.startup_logic == StartWhenBufferFull){
322+
is_a2dp_active = false;
323+
}
324+
a2dp_buffer.clear();
325+
}
326+
318327
protected:
319328
A2DPConfig config;
320329
BluetoothA2DPSource *a2dp_source = nullptr;

0 commit comments

Comments
 (0)