Skip to content

Commit 279d59c

Browse files
committed
Add explanation for ResultWithValue=>Result type coercion
1 parent 8d5e1a5 commit 279d59c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

docs/FullGuide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,9 @@ The callback does a non-blocking read from the input stream placing the data int
333333
void *audioData,
334334
int32_t numFrames){
335335
auto result = stream2.read(audioData, numFrames, timeout);
336+
// result has type ResultWithValue<int32_t>, which for convenience is coerced to a Result type when compared with another Result.
336337
if (result == Result::OK){
337-
if (result == numFrames)
338+
if (result.value() == numFrames)
338339
return DataCallbackResult::Continue;
339340
if (result.value() >= 0) {
340341
memset(static_cast<sample_type*>(audioData) + result.value() * samplesPerFrame, 0,

0 commit comments

Comments
 (0)