Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
7a3ec5d7
Commit
7a3ec5d7
authored
23 years ago
by
Eric Pouech
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some buffers issue in recording.
Zeroed unnecessary second parameter for WIM_DATA notification.
parent
2b713ba6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/winmm/wineoss/audio.c
+22
-23
22 additions, 23 deletions
dlls/winmm/wineoss/audio.c
with
22 additions
and
23 deletions
dlls/winmm/wineoss/audio.c
+
22
−
23
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
=
lpWaveHdr
->
lpNext
;
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
"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment