Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7a3ec5d7
Commit
7a3ec5d7
authored
Apr 13, 2001
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 13, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some buffers issue in recording.
Zeroed unnecessary second parameter for WIM_DATA notification.
parent
2b713ba6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
+22
-23
audio.c
dlls/winmm/wineoss/audio.c
+22
-23
No files found.
dlls/winmm/wineoss/audio.c
View file @
7a3ec5d7
...
...
@@ -354,8 +354,7 @@ LONG OSS_WaveInit(void)
/**************************************************************************
* OSS_NotifyClient [internal]
*/
static
DWORD
OSS_NotifyClient
(
UINT
wDevID
,
WORD
wMsg
,
DWORD
dwParam1
,
DWORD
dwParam2
)
static
DWORD
OSS_NotifyClient
(
UINT
wDevID
,
WORD
wMsg
,
DWORD
dwParam1
,
DWORD
dwParam2
)
{
TRACE
(
"wDevID = %04X wMsg = 0x%04x dwParm1 = %04lX dwParam2 = %04lX
\n
"
,
wDevID
,
wMsg
,
dwParam1
,
dwParam2
);
...
...
@@ -1759,11 +1758,9 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
{
lpWaveHdr
=
wwi
->
lpQueuePtr
;
ioctl
(
wwi
->
unixdev
,
SNDCTL_DSP_GETISPACE
,
&
info
);
TRACE
(
"info={frag=%d fsize=%d ftotal=%d bytes=%d}
\n
"
,
info
.
fragments
,
info
.
fragsize
,
info
.
fragstotal
,
info
.
bytes
);
/* read all the fragments accumulated so far */
while
((
info
.
fragments
>
0
)
&&
(
wwi
->
lpQueuePtr
))
{
...
...
@@ -1786,17 +1783,20 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
/* buffer is full. notify client */
if
(
lpWaveHdr
->
dwBytesRecorded
==
lpWaveHdr
->
dwBufferLength
)
{
/* must copy the value of next waveHdr, because we have no idea of what
* will be done with the content of lpWaveHdr in callback
*/
LPWAVEHDR
lpNext
=
lpWaveHdr
->
lpNext
;
lpWaveHdr
->
dwFlags
&=
~
WHDR_INQUEUE
;
lpWaveHdr
->
dwFlags
|=
WHDR_DONE
;
if
(
OSS_NotifyClient
(
uDevID
,
WIM_DATA
,
(
DWORD
)
lpWaveHdr
,
lpWaveHdr
->
dwBytesRecorded
)
!=
MMSYSERR_NOERROR
)
if
(
OSS_NotifyClient
(
uDevID
,
WIM_DATA
,
(
DWORD
)
lpWaveHdr
,
0
)
!=
MMSYSERR_NOERROR
)
{
WARN
(
"can't notify client !
\n
"
);
}
lpWaveHdr
=
wwi
->
lpQueuePtr
=
lp
WaveHdr
->
lp
Next
;
lpWaveHdr
=
wwi
->
lpQueuePtr
=
lpNext
;
}
}
}
...
...
@@ -1826,28 +1826,27 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
/* client buffer is full. notify client */
if
(
lpWaveHdr
->
dwBytesRecorded
==
lpWaveHdr
->
dwBufferLength
)
{
/* must copy the value of next waveHdr, because we have no idea of what
* will be done with the content of lpWaveHdr in callback
*/
LPWAVEHDR
lpNext
=
lpWaveHdr
->
lpNext
;
TRACE
(
"lpNext=%p
\n
"
,
lpNext
);
lpWaveHdr
->
dwFlags
&=
~
WHDR_INQUEUE
;
lpWaveHdr
->
dwFlags
|=
WHDR_DONE
;
if
(
OSS_NotifyClient
(
uDevID
,
WIM_DATA
,
(
DWORD
)
lpWaveHdr
,
lpWaveHdr
->
dwBytesRecorded
)
!=
MMSYSERR_NOERROR
)
if
(
OSS_NotifyClient
(
uDevID
,
WIM_DATA
,
(
DWORD
)
lpWaveHdr
,
0
)
!=
MMSYSERR_NOERROR
)
{
WARN
(
"can't notify client !
\n
"
);
}
if
(
lpWaveHdr
->
lpNext
)
{
lpWaveHdr
=
lpWaveHdr
->
lpNext
;
wwi
->
lpQueuePtr
=
lpWaveHdr
;
}
else
{
wwi
->
lpQueuePtr
=
lpWaveHdr
=
lpNext
;
if
(
!
lpNext
&&
bytesRead
)
{
/* no more buffer to copy data to, but we did read more.
* what hasn't been copied will be dropped
*/
if
(
bytesRead
)
WARN
(
"buffer ov
er run! %lu bytes dropped.
\n
"
,
bytesRead
);
WARN
(
"buffer und
er run! %lu bytes dropped.
\n
"
,
bytesRead
);
wwi
->
lpQueuePtr
=
NULL
;
break
;
}
...
...
@@ -1910,8 +1909,8 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
lpWaveHdr
->
dwFlags
&=
~
WHDR_INQUEUE
;
lpWaveHdr
->
dwFlags
|=
WHDR_DONE
;
if
(
OSS_NotifyClient
(
uDevID
,
WIM_DATA
,
(
DWORD
)
lpWaveHdr
,
lpWaveHdr
->
dwBytesRecorded
)
!=
MMSYSERR_NOERROR
)
{
if
(
OSS_NotifyClient
(
uDevID
,
WIM_DATA
,
(
DWORD
)
lpWaveHdr
,
0
)
!=
MMSYSERR_NOERROR
)
{
WARN
(
"can't notify client !
\n
"
);
}
}
...
...
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