A bit more robust handling on read() or write() errors.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1375 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
dea4960e3a
commit
95c21876c1
20
rdpsnd_oss.c
20
rdpsnd_oss.c
@ -49,6 +49,7 @@ static int dsp_mode;
|
|||||||
static int dsp_refs;
|
static int dsp_refs;
|
||||||
|
|
||||||
static RD_BOOL dsp_configured;
|
static RD_BOOL dsp_configured;
|
||||||
|
static RD_BOOL dsp_broken;
|
||||||
|
|
||||||
static RD_BOOL dsp_out;
|
static RD_BOOL dsp_out;
|
||||||
static RD_BOOL dsp_in;
|
static RD_BOOL dsp_in;
|
||||||
@ -131,6 +132,7 @@ oss_open(int fallback)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dsp_configured = False;
|
dsp_configured = False;
|
||||||
|
dsp_broken = False;
|
||||||
|
|
||||||
dsp_mode = O_RDWR;
|
dsp_mode = O_RDWR;
|
||||||
dsp_fd = open(dsp_dev, O_RDWR | O_NONBLOCK);
|
dsp_fd = open(dsp_dev, O_RDWR | O_NONBLOCK);
|
||||||
@ -389,10 +391,17 @@ oss_play(void)
|
|||||||
if (len == -1)
|
if (len == -1)
|
||||||
{
|
{
|
||||||
if (errno != EWOULDBLOCK)
|
if (errno != EWOULDBLOCK)
|
||||||
perror("write audio");
|
{
|
||||||
|
if (!dsp_broken)
|
||||||
|
perror("RDPSND: write()");
|
||||||
|
dsp_broken = True;
|
||||||
|
rdpsnd_queue_next(0);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dsp_broken = False;
|
||||||
|
|
||||||
out->p += len;
|
out->p += len;
|
||||||
|
|
||||||
if (out->p == out->end)
|
if (out->p == out->end)
|
||||||
@ -441,10 +450,17 @@ oss_record(void)
|
|||||||
if (len == -1)
|
if (len == -1)
|
||||||
{
|
{
|
||||||
if (errno != EWOULDBLOCK)
|
if (errno != EWOULDBLOCK)
|
||||||
perror("read audio");
|
{
|
||||||
|
if (!dsp_broken)
|
||||||
|
perror("RDPSND: read()");
|
||||||
|
dsp_broken = True;
|
||||||
|
rdpsnd_queue_next(0);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dsp_broken = False;
|
||||||
|
|
||||||
rdpsnd_record(buffer, len);
|
rdpsnd_record(buffer, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user