Skip to content

Commit b3cff2b

Browse files
ovianoRytoEX
authored andcommitted
Add audio buffer option to audio config
1 parent 7d40c7f commit b3cff2b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

dshowcapture.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ struct AudioConfig : Config {
208208

209209
/** Audio playback mode */
210210
AudioMode mode = AudioMode::Capture;
211+
212+
/** Desired buffer */
213+
int buffer = 0;
211214
};
212215

213216
class DSHOWCAPTURE_EXPORT Device {

source/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ bool HDevice::ConnectFilters()
802802
std::string::npos);
803803

804804
if (!streamEngine && audioCapture != nullptr)
805-
SetAudioBuffering(10);
805+
SetAudioBuffering(audioConfig.buffer ? audioConfig.buffer : 10);
806806

807807
success = ConnectPins(PIN_CATEGORY_CAPTURE, MEDIATYPE_Audio,
808808
audioFilter, filter);

0 commit comments

Comments
 (0)