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
234558c2
Commit
234558c2
authored
Dec 21, 2006
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Move a memset out of a mutex-guarded section.
parent
acf34999
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
31 deletions
+30
-31
audio.c
dlls/winmm/winecoreaudio/audio.c
+30
-31
No files found.
dlls/winmm/winecoreaudio/audio.c
View file @
234558c2
...
...
@@ -1365,47 +1365,46 @@ OSStatus CoreAudio_woAudioUnitIOProc(void *inRefCon,
pthread_mutex_lock
(
&
wwo
->
lock
);
while
(
dataNeeded
>
0
)
while
(
dataNeeded
>
0
&&
wwo
->
state
==
WINE_WS_PLAYING
&&
wwo
->
lpPlayPtr
)
{
if
(
wwo
->
state
==
WINE_WS_PLAYING
&&
wwo
->
lpPlayPtr
)
{
unsigned
int
available
=
wwo
->
lpPlayPtr
->
dwBufferLength
-
wwo
->
dwPartialOffset
;
unsigned
int
toCopy
;
if
(
available
>=
dataNeeded
)
toCopy
=
dataNeeded
;
else
toCopy
=
available
;
unsigned
int
available
=
wwo
->
lpPlayPtr
->
dwBufferLength
-
wwo
->
dwPartialOffset
;
unsigned
int
toCopy
;
if
(
toCopy
>
0
)
{
memcpy
((
char
*
)
ioData
->
mBuffers
[
0
].
mData
+
dataProvided
,
wwo
->
lpPlayPtr
->
lpData
+
wwo
->
dwPartialOffset
,
toCopy
);
wwo
->
dwPartialOffset
+=
toCopy
;
wwo
->
dwPlayedTotal
+=
toCopy
;
dataProvided
+=
toCopy
;
dataNeeded
-=
toCopy
;
available
-=
toCopy
;
}
if
(
available
>=
dataNeeded
)
toCopy
=
dataNeeded
;
else
toCopy
=
available
;
if
(
available
==
0
)
{
wodHelper_PlayPtrNext
(
wwo
);
needNotify
=
1
;
}
if
(
toCopy
>
0
)
{
memcpy
((
char
*
)
ioData
->
mBuffers
[
0
].
mData
+
dataProvided
,
wwo
->
lpPlayPtr
->
lpData
+
wwo
->
dwPartialOffset
,
toCopy
);
wwo
->
dwPartialOffset
+=
toCopy
;
wwo
->
dwPlayedTotal
+=
toCopy
;
dataProvided
+=
toCopy
;
dataNeeded
-=
toCopy
;
available
-=
toCopy
;
}
else
if
(
available
==
0
)
{
if
(
!
dataProvided
)
*
ioActionFlags
|=
kAudioUnitRenderAction_OutputIsSilence
;
memset
((
char
*
)
ioData
->
mBuffers
[
0
].
mData
+
dataProvided
,
0
,
dataNeeded
);
dataProvided
+=
dataNeeded
;
dataNeeded
=
0
;
wodHelper_PlayPtrNext
(
wwo
);
needNotify
=
1
;
}
}
pthread_mutex_unlock
(
&
wwo
->
lock
);
/* We can't provide any more wave data. Fill the rest with silence. */
if
(
dataNeeded
>
0
)
{
if
(
!
dataProvided
)
*
ioActionFlags
|=
kAudioUnitRenderAction_OutputIsSilence
;
memset
((
char
*
)
ioData
->
mBuffers
[
0
].
mData
+
dataProvided
,
0
,
dataNeeded
);
dataProvided
+=
dataNeeded
;
dataNeeded
=
0
;
}
/* We only fill buffer 0. Set any others that might be requested to 0. */
for
(
buffer
=
1
;
buffer
<
ioData
->
mNumberBuffers
;
buffer
++
)
{
...
...
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