Codebase list squeezelite / 8a7b7ad
handle errors from snd_pcm_delay Adrian Smith 10 years ago
1 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
826826 #if ALSA
827827 snd_pcm_sframes_t delay;
828828 snd_pcm_delay(pcmp, &delay);
829 output.device_frames = delay;
829 if (delay >= 0) {
830 output.device_frames = delay;
831 } else {
832 LOG_WARN("snd_pcm_delay returns: %d", delay);
833 if (delay == -EPIPE) {
834 // EPIPE indicates underrun - attempt to recover
835 UNLOCK;
836 continue;
837 }
838 }
830839 #endif
831840 #if PORTAUDIO
832841 output.device_frames = (unsigned)((time_info->outputBufferDacTime - Pa_GetStreamTime(pa.stream)) * output.current_sample_rate);