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
950b8a96
Commit
950b8a96
authored
May 01, 2017
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Avoid an intermediate copy in PackStructured().
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7cd7f146
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
buffer.c
dlls/dmusic/buffer.c
+7
-7
No files found.
dlls/dmusic/buffer.c
View file @
950b8a96
...
...
@@ -101,7 +101,7 @@ static HRESULT WINAPI IDirectMusicBufferImpl_PackStructured(LPDIRECTMUSICBUFFER
{
IDirectMusicBufferImpl
*
This
=
impl_from_IDirectMusicBuffer
(
iface
);
DWORD
new_write_pos
=
This
->
write_pos
+
DMUS_EVENT_SIZE
(
sizeof
(
channel_message
));
DMUS_EVENTHEADER
header
;
DMUS_EVENTHEADER
*
header
;
TRACE
(
"(%p)->(0x%s, %u, 0x%x)
\n
"
,
iface
,
wine_dbgstr_longlong
(
ref_time
),
channel_group
,
channel_message
);
...
...
@@ -119,13 +119,13 @@ static HRESULT WINAPI IDirectMusicBufferImpl_PackStructured(LPDIRECTMUSICBUFFER
if
(
!
This
->
write_pos
)
This
->
start_time
=
ref_time
;
header
.
cbEvent
=
3
;
/* Midi message takes 4 bytes space but only 3 are relevant */
header
.
dwChannelGroup
=
channel_group
;
header
.
rtDelta
=
ref_time
-
This
->
start_time
;
header
.
dwFlags
=
DMUS_EVENT_STRUCTURED
;
header
=
(
DMUS_EVENTHEADER
*
)
&
This
->
data
[
This
->
write_pos
];
header
->
cbEvent
=
3
;
/* Midi message takes 4 bytes space but only 3 are relevant */
header
->
dwChannelGroup
=
channel_group
;
header
->
rtDelta
=
ref_time
-
This
->
start_time
;
header
->
dwFlags
=
DMUS_EVENT_STRUCTURED
;
memcpy
(
This
->
data
+
This
->
write_pos
,
&
header
,
sizeof
(
header
));
*
(
DWORD
*
)(
This
->
data
+
This
->
write_pos
+
sizeof
(
header
))
=
channel_message
;
*
(
DWORD
*
)
&
header
[
1
]
=
channel_message
;
This
->
write_pos
=
new_write_pos
;
return
S_OK
;
...
...
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