Package list squeezelite / be83522
use Pa_OpenStream rather than Pa_IsFormatSupported as it is believed to work in more cases Adrian Smith 8 years ago
1 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
428428 outputParameters.hostApiSpecificStreamInfo = NULL;
429429
430430 // check supported sample rates
431 // Note this does not appear to work on OSX - it always returns paNoError...
431 // Note use Pa_OpenStream as it appears more reliable than Pa_OpenStream on some windows apis
432432 for (i = 0; rates[i]; ++i) {
433 if (Pa_IsFormatSupported(NULL, &outputParameters, (double)rates[i]) == paNoError) {
433 err = Pa_OpenStream(&pa.stream, NULL, &outputParameters, (double)rates[i], paFramesPerBufferUnspecified, paNoFlag,
434 pa_callback, NULL);
435 if (err == paNoError) {
436 Pa_CloseStream(pa.stream);
434437 *max_rate = rates[i];
435438 break;
436439 }
440 }
441
442 if (!rates[i]) {
443 LOG_WARN("no available rate found");
444 return false;
437445 }
438446
439447 if ((err = Pa_OpenStream(&pa.stream, NULL, &outputParameters, (double)*max_rate, paFramesPerBufferUnspecified,