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
23603589
Commit
23603589
authored
May 24, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
May 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Block align SetCurrentPosition and add test for it.
parent
ea2c96c5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
buffer.c
dlls/dsound/buffer.c
+1
-0
dsound.c
dlls/dsound/tests/dsound.c
+15
-1
No files found.
dlls/dsound/buffer.c
View file @
23603589
...
...
@@ -687,6 +687,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetCurrentPosition(
EnterCriticalSection
(
&
(
This
->
lock
));
newpos
%=
This
->
buflen
;
newpos
-=
newpos
%
This
->
pwfx
->
nBlockAlign
;
This
->
buf_mixpos
=
newpos
;
if
(
This
->
hwbuf
)
{
hres
=
IDsDriverBuffer_SetPosition
(
This
->
hwbuf
,
This
->
buf_mixpos
);
...
...
dlls/dsound/tests/dsound.c
View file @
23603589
...
...
@@ -9,6 +9,7 @@
* So this is only done if the test is being run in interactive mode.
*
* Copyright (c) 2002-2004 Francois Gouget
* Copyright (c) 2007 Maarten Lankhorst
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -764,6 +765,7 @@ static HRESULT test_block_align(LPGUID lpGuid)
DSBUFFERDESC
bufdesc
;
DSBCAPS
dsbcaps
;
WAVEFORMATEX
wfx
;
DWORD
pos
,
pos2
;
int
ref
;
/* Create the DirectSound object */
...
...
@@ -790,11 +792,23 @@ static HRESULT test_block_align(LPGUID lpGuid)
rc
=
IDirectSoundBuffer_GetCaps
(
secondary
,
&
dsbcaps
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_GetCaps() should have returned DS_OK, "
"returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
)
if
(
rc
==
DS_OK
&&
wfx
.
nBlockAlign
>
1
)
{
ok
(
dsbcaps
.
dwBufferBytes
==
(
wfx
.
nAvgBytesPerSec
+
wfx
.
nBlockAlign
),
"Buffer size not a multiple of nBlockAlign: requested %d, "
"got %d, should be %d
\n
"
,
bufdesc
.
dwBufferBytes
,
dsbcaps
.
dwBufferBytes
,
wfx
.
nAvgBytesPerSec
+
wfx
.
nBlockAlign
);
rc
=
IDirectSoundBuffer_SetCurrentPosition
(
secondary
,
0
);
ok
(
rc
==
DS_OK
,
"Could not set position to 0: %s
\n
"
,
DXGetErrorString8
(
rc
));
rc
=
IDirectSoundBuffer_GetCurrentPosition
(
secondary
,
&
pos
,
NULL
);
ok
(
rc
==
DS_OK
,
"Could not get position: %s
\n
"
,
DXGetErrorString8
(
rc
));
rc
=
IDirectSoundBuffer_SetCurrentPosition
(
secondary
,
1
);
ok
(
rc
==
DS_OK
,
"Could not set position to 1: %s
\n
"
,
DXGetErrorString8
(
rc
));
rc
=
IDirectSoundBuffer_GetCurrentPosition
(
secondary
,
&
pos2
,
NULL
);
ok
(
rc
==
DS_OK
,
"Could not get new position: %s
\n
"
,
DXGetErrorString8
(
rc
));
ok
(
pos
==
pos2
,
"Positions not the same! Old position: %d, new position: %d
\n
"
,
pos
,
pos2
);
}
ref
=
IDirectSoundBuffer_Release
(
secondary
);
ok
(
ref
==
0
,
"IDirectSoundBuffer_Release() secondary has %d references, "
"should have 0
\n
"
,
ref
);
...
...
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