We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f54a439 commit 09111f0Copy full SHA for 09111f0
examples/stream/stream.cpp
@@ -302,11 +302,11 @@ int main(int argc, char ** argv) {
302
}
303
} else {
304
// piped: need at least step_ms but try to get length_ms at first
305
- const auto n_bytes_min = (n_samples_step - n_samples_new) * sizeof(float);
+ const auto n_bytes_min = std::max<long>(0, (n_samples_step - n_samples_new) * sizeof(float));
306
auto n_bytes_wanted = n_samples_len * sizeof(float);
307
pcmf32.resize(n_samples_len);
308
309
- auto n_bytes_read = 0;
+ long n_bytes_read = 0;
310
while (n_bytes_wanted > 0) {
311
char *p_buf = (char *)pcmf32.data();
312
const auto n_read = read(fileno(stdin), p_buf + n_bytes_read, n_bytes_wanted);
0 commit comments