[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: arts/flow
From: Waldo Bastian <bastian () kde ! org>
Date: 2005-03-09 13:34:36
Message-ID: 20050309133436.33CDF10B25 () office ! kde ! org
[Download RAW message or body]
CVS commit by waba:
Attempt to fix artsd problem on suspend: handle EINTR
M +6 -1 audioioalsa.cc 1.12
M +6 -2 audioioalsa9.cc 1.13
--- arts/flow/audioioalsa.cc #1.11:1.12
@@ -375,5 +375,8 @@ int AudioIOALSA::getParam(AudioParam p)
int AudioIOALSA::read(void *buffer, int size)
{
- int length = snd_pcm_read(m_pcm_handle, buffer, size);
+ int length;
+ do {
+ length = snd_pcm_read(m_pcm_handle, buffer, size);
+ } while (length == -EINTR);
if(length == -EPIPE) {
snd_pcm_channel_status_t status;
@@ -411,4 +414,6 @@ int AudioIOALSA::write(void *buffer, int
{
while(snd_pcm_write(m_pcm_handle, buffer, size) != size) {
+ if (size == -EINTR)
+ continue; // Try again
snd_pcm_channel_status_t status;
(void)memset(&status, 0, sizeof(status));
--- arts/flow/audioioalsa9.cc #1.12:1.13
@@ -395,5 +395,7 @@ int AudioIOALSA::read(void *buffer, int
int length;
while ((length = snd_pcm_readi(m_pcm_capture, buffer, frames)) < 0) {
- if (length == -EPIPE)
+ if (length == -EINTR)
+ continue; // Try again
+ else if (length == -EPIPE)
length = xrun(m_pcm_capture);
#ifdef HAVE_SND_PCM_RESUME
@@ -414,5 +416,7 @@ int AudioIOALSA::write(void *buffer, int
int length;
while ((length = snd_pcm_writei(m_pcm_playback, buffer, frames)) < 0) {
- if (length == -EPIPE)
+ if (length == -EINTR)
+ continue; // Try again
+ else if (length == -EPIPE)
length = xrun(m_pcm_playback);
#ifdef HAVE_SND_PCM_RESUME
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic