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
f7cae999
Commit
f7cae999
authored
Dec 12, 2003
by
Jeremy Shaw
Committed by
Alexandre Julliard
Dec 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the data around when the ring buffer is resized so that the empty
messages are between the tosave and toget indexes.
parent
17b9837a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
audio.c
dlls/winmm/winealsa/audio.c
+13
-0
audio.c
dlls/winmm/winenas/audio.c
+13
-0
audio.c
dlls/winmm/wineoss/audio.c
+13
-0
No files found.
dlls/winmm/winealsa/audio.c
View file @
f7cae999
...
@@ -717,9 +717,22 @@ static int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWOR
...
@@ -717,9 +717,22 @@ static int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWOR
EnterCriticalSection
(
&
omr
->
msg_crst
);
EnterCriticalSection
(
&
omr
->
msg_crst
);
if
((
omr
->
msg_toget
==
((
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
)))
if
((
omr
->
msg_toget
==
((
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
)))
{
{
int
old_ring_buffer_size
=
omr
->
ring_buffer_size
;
omr
->
ring_buffer_size
+=
ALSA_RING_BUFFER_INCREMENT
;
omr
->
ring_buffer_size
+=
ALSA_RING_BUFFER_INCREMENT
;
TRACE
(
"omr->ring_buffer_size=%d
\n
"
,
omr
->
ring_buffer_size
);
TRACE
(
"omr->ring_buffer_size=%d
\n
"
,
omr
->
ring_buffer_size
);
omr
->
messages
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
omr
->
messages
,
omr
->
ring_buffer_size
*
sizeof
(
ALSA_MSG
));
omr
->
messages
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
omr
->
messages
,
omr
->
ring_buffer_size
*
sizeof
(
ALSA_MSG
));
/* Now we need to rearrange the ring buffer so that the new
buffers just allocated are in between omr->msg_tosave and
omr->msg_toget.
*/
if
(
omr
->
msg_tosave
<
omr
->
msg_toget
)
{
memmove
(
&
(
omr
->
messages
[
omr
->
msg_toget
+
ALSA_RING_BUFFER_INCREMENT
]),
&
(
omr
->
messages
[
omr
->
msg_toget
]),
sizeof
(
ALSA_MSG
)
*
(
old_ring_buffer_size
-
omr
->
msg_toget
)
);
omr
->
msg_toget
+=
ALSA_RING_BUFFER_INCREMENT
;
}
}
}
if
(
wait
)
if
(
wait
)
{
{
...
...
dlls/winmm/winenas/audio.c
View file @
f7cae999
...
@@ -454,9 +454,22 @@ static int NAS_AddRingMessage(MSG_RING* mr, enum win_wm_message msg, DWORD param
...
@@ -454,9 +454,22 @@ static int NAS_AddRingMessage(MSG_RING* mr, enum win_wm_message msg, DWORD param
EnterCriticalSection
(
&
mr
->
msg_crst
);
EnterCriticalSection
(
&
mr
->
msg_crst
);
if
((
mr
->
msg_toget
==
((
mr
->
msg_tosave
+
1
)
%
mr
->
ring_buffer_size
)))
if
((
mr
->
msg_toget
==
((
mr
->
msg_tosave
+
1
)
%
mr
->
ring_buffer_size
)))
{
{
int
old_ring_buffer_size
=
mr
->
ring_buffer_size
;
mr
->
ring_buffer_size
+=
NAS_RING_BUFFER_INCREMENT
;
mr
->
ring_buffer_size
+=
NAS_RING_BUFFER_INCREMENT
;
TRACE
(
"omr->ring_buffer_size=%d
\n
"
,
mr
->
ring_buffer_size
);
TRACE
(
"omr->ring_buffer_size=%d
\n
"
,
mr
->
ring_buffer_size
);
mr
->
messages
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
mr
->
messages
,
mr
->
ring_buffer_size
*
sizeof
(
RING_MSG
));
mr
->
messages
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
mr
->
messages
,
mr
->
ring_buffer_size
*
sizeof
(
RING_MSG
));
/* Now we need to rearrange the ring buffer so that the new
buffers just allocated are in between mr->msg_tosave and
mr->msg_toget.
*/
if
(
mr
->
msg_tosave
<
mr
->
msg_toget
)
{
memmove
(
&
(
mr
->
messages
[
mr
->
msg_toget
+
NAS_RING_BUFFER_INCREMENT
]),
&
(
mr
->
messages
[
mr
->
msg_toget
]),
sizeof
(
RING_MSG
)
*
(
old_ring_buffer_size
-
mr
->
msg_toget
)
);
mr
->
msg_toget
+=
NAS_RING_BUFFER_INCREMENT
;
}
}
}
if
(
wait
)
if
(
wait
)
{
{
...
...
dlls/winmm/wineoss/audio.c
View file @
f7cae999
...
@@ -909,9 +909,22 @@ static int OSS_AddRingMessage(OSS_MSG_RING* omr, enum win_wm_message msg, DWORD
...
@@ -909,9 +909,22 @@ static int OSS_AddRingMessage(OSS_MSG_RING* omr, enum win_wm_message msg, DWORD
EnterCriticalSection
(
&
omr
->
msg_crst
);
EnterCriticalSection
(
&
omr
->
msg_crst
);
if
((
omr
->
msg_toget
==
((
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
)))
if
((
omr
->
msg_toget
==
((
omr
->
msg_tosave
+
1
)
%
omr
->
ring_buffer_size
)))
{
{
int
old_ring_buffer_size
=
omr
->
ring_buffer_size
;
omr
->
ring_buffer_size
+=
OSS_RING_BUFFER_INCREMENT
;
omr
->
ring_buffer_size
+=
OSS_RING_BUFFER_INCREMENT
;
TRACE
(
"omr->ring_buffer_size=%d
\n
"
,
omr
->
ring_buffer_size
);
TRACE
(
"omr->ring_buffer_size=%d
\n
"
,
omr
->
ring_buffer_size
);
omr
->
messages
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
omr
->
messages
,
omr
->
ring_buffer_size
*
sizeof
(
OSS_MSG
));
omr
->
messages
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
omr
->
messages
,
omr
->
ring_buffer_size
*
sizeof
(
OSS_MSG
));
/* Now we need to rearrange the ring buffer so that the new
buffers just allocated are in between omr->msg_tosave and
omr->msg_toget.
*/
if
(
omr
->
msg_tosave
<
omr
->
msg_toget
)
{
memmove
(
&
(
omr
->
messages
[
omr
->
msg_toget
+
OSS_RING_BUFFER_INCREMENT
]),
&
(
omr
->
messages
[
omr
->
msg_toget
]),
sizeof
(
OSS_MSG
)
*
(
old_ring_buffer_size
-
omr
->
msg_toget
)
);
omr
->
msg_toget
+=
OSS_RING_BUFFER_INCREMENT
;
}
}
}
if
(
wait
)
if
(
wait
)
{
{
...
...
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