handle errors from snd_pcm_delay
Adrian Smith
10 years ago
826 | 826 | #if ALSA |
827 | 827 | snd_pcm_sframes_t delay; |
828 | 828 | 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 | } | |
830 | 839 | #endif |
831 | 840 | #if PORTAUDIO |
832 | 841 | output.device_frames = (unsigned)((time_info->outputBufferDacTime - Pa_GetStreamTime(pa.stream)) * output.current_sample_rate); |