Reduce the max wait from 1 second to 1 msec to prevent pauses
between sounds. Also check the return value of the samplerate
converter src_process() and if there was an error, tell the caller
to try calling again.
rsmp->src_data.input_frames = smps;
}
- src_process(rsmp->src_state, &rsmp->src_data);
+ if (src_process(rsmp->src_state, &rsmp->src_data))
+ {
+ /*
+ * src_process returned an error, don't update
+ * the rsmp structure, and tell the caller to
+ * re-run the resampler
+ */
+ return 1;
+ }
int u_in = rsmp->src_data.input_frames_used;
rsmp->src_data.data_in += 2*u_in;
/*
* If the timeout is 0, we still want to call os_tick once per second
*/
- maxwait.tv_sec=1;
- maxwait.tv_usec=0;
+ maxwait.tv_sec=0;
+ maxwait.tv_usec=1000;
while(1) {
/* Wait with select so that we get interrupted on SIGWINCH. */