Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9fb2cacd
Commit
9fb2cacd
authored
Dec 07, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Dec 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa: Fix return value checking in wavein.
parent
02e1ce0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
wavein.c
dlls/winealsa.drv/wavein.c
+7
-6
No files found.
dlls/winealsa.drv/wavein.c
View file @
9fb2cacd
...
...
@@ -162,7 +162,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
/* make sleep time to be # of ms to output a period */
dwSleepTime
=
(
wwi
->
dwPeriodSize
*
1000
)
/
wwi
->
format
.
Format
.
nAvgBytesPerSec
;
frames_per_period
=
snd_pcm_bytes_to_frames
(
wwi
->
pcm
,
wwi
->
dwPeriodSize
);
TRACE
(
"sleeptime=%d ms
\n
"
,
dwSleepTim
e
);
TRACE
(
"sleeptime=%d ms
, total buffer length=%d ms (%d bytes)
\n
"
,
dwSleepTime
,
wwi
->
dwBufferSize
*
1000
/
wwi
->
format
.
Format
.
nAvgBytesPerSec
,
wwi
->
dwBufferSiz
e
);
for
(;;)
{
/* wait for dwSleepTime or an event in thread's queue */
...
...
@@ -180,6 +180,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
/* read all the fragments accumulated so far */
frames
=
snd_pcm_avail_update
(
wwi
->
pcm
);
bytes
=
snd_pcm_frames_to_bytes
(
wwi
->
pcm
,
frames
);
TRACE
(
"frames = %d bytes = %d
\n
"
,
frames
,
bytes
);
periods
=
bytes
/
wwi
->
dwPeriodSize
;
while
((
periods
>
0
)
&&
(
wwi
->
lpQueuePtr
))
...
...
@@ -194,7 +195,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
bytesRead
=
snd_pcm_frames_to_bytes
(
wwi
->
pcm
,
read
);
TRACE
(
"bytesRead=%d (direct)
\n
"
,
bytesRead
);
if
(
bytesR
ead
!=
(
DWORD
)
-
1
)
if
(
r
ead
!=
(
DWORD
)
-
1
)
{
/* update number of bytes recorded in current buffer and by this device */
lpWaveHdr
->
dwBytesRecorded
+=
bytesRead
;
...
...
@@ -216,9 +217,9 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
lpWaveHdr
=
lpNext
;
}
}
else
{
TRAC
E
(
"read(%s, %p, %d) failed (%s)
\n
"
,
wwi
->
pcmname
,
FIXM
E
(
"read(%s, %p, %d) failed (%s)
\n
"
,
wwi
->
pcmname
,
lpWaveHdr
->
lpData
+
lpWaveHdr
->
dwBytesRecorded
,
frames_per_period
,
s
trerror
(
errno
));
frames_per_period
,
s
nd_strerror
(
read
));
}
}
else
...
...
@@ -230,14 +231,14 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
TRACE
(
"bytesRead=%d (local)
\n
"
,
bytesRead
);
if
(
bytesR
ead
==
(
DWORD
)
-
1
)
{
if
(
r
ead
==
(
DWORD
)
-
1
)
{
TRACE
(
"read(%s, %p, %d) failed (%s)
\n
"
,
wwi
->
pcmname
,
buffer
,
frames_per_period
,
strerror
(
errno
));
continue
;
}
/* copy data in client buffers */
while
(
bytesR
ead
!=
(
DWORD
)
-
1
&&
bytesRead
>
0
)
while
(
r
ead
!=
(
DWORD
)
-
1
&&
bytesRead
>
0
)
{
DWORD
dwToCopy
=
min
(
bytesRead
,
lpWaveHdr
->
dwBufferLength
-
lpWaveHdr
->
dwBytesRecorded
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment