Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions internal/oboe/binding_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ void Stream::DeferStartLocked() {

const char *Stream::Play(int sample_rate, int channel_num,
int buffer_size_in_bytes) {
// The frame counts and the read wait below divide by these, so a value the
// caller left at zero would fault instead of reporting a bad configuration.
if (sample_rate <= 0) {
return "oto_oboe_Play: sample rate must be positive";
}
if (channel_num <= 0) {
return "oto_oboe_Play: channel count must be positive";
}

std::lock_guard<std::mutex> lock{mutex_};
sample_rate_ = sample_rate;
channel_num_ = channel_num;
Expand Down
Loading