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
Lorenzo Ferrillo
wine
Commits
3cb2ddfd
Commit
3cb2ddfd
authored
11 years ago
by
Andrew Eikum
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
msacm32: Don't clear DONE flag in Un,PrepareHeader.
parent
39185814
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/msacm32/stream.c
+2
-5
2 additions, 5 deletions
dlls/msacm32/stream.c
dlls/msacm32/tests/msacm.c
+85
-2
85 additions, 2 deletions
dlls/msacm32/tests/msacm.c
with
87 additions
and
7 deletions
dlls/msacm32/stream.c
+
2
−
5
View file @
3cb2ddfd
...
...
@@ -311,9 +311,6 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
if
(
fdwPrepare
)
ret
=
MMSYSERR_INVALFLAG
;
if
(
pash
->
fdwStatus
&
ACMSTREAMHEADER_STATUSF_DONE
)
return
MMSYSERR_NOERROR
;
/* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
* size. some fields are private to msacm internals, and are exposed
* in ACMSTREAMHEADER in the dwReservedDriver array
...
...
@@ -334,7 +331,7 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
ret
=
MSACM_Message
((
HACMDRIVER
)
was
->
pDrv
,
ACMDM_STREAM_PREPARE
,
(
LPARAM
)
&
was
->
drvInst
,
(
LPARAM
)
padsh
);
if
(
ret
==
MMSYSERR_NOERROR
||
ret
==
MMSYSERR_NOTSUPPORTED
)
{
ret
=
MMSYSERR_NOERROR
;
padsh
->
fdwStatus
&=
~
(
ACMSTREAMHEADER_STATUSF_DONE
|
ACMSTREAMHEADER_STATUSF_INQUEUE
)
;
padsh
->
fdwStatus
&=
~
ACMSTREAMHEADER_STATUSF_INQUEUE
;
padsh
->
fdwStatus
|=
ACMSTREAMHEADER_STATUSF_PREPARED
;
padsh
->
fdwPrepared
=
padsh
->
fdwStatus
;
padsh
->
dwPrepared
=
0
;
...
...
@@ -477,7 +474,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
ret
=
MSACM_Message
((
HACMDRIVER
)
was
->
pDrv
,
ACMDM_STREAM_UNPREPARE
,
(
LPARAM
)
&
was
->
drvInst
,
(
LPARAM
)
padsh
);
if
(
ret
==
MMSYSERR_NOERROR
||
ret
==
MMSYSERR_NOTSUPPORTED
)
{
ret
=
MMSYSERR_NOERROR
;
padsh
->
fdwStatus
&=
~
(
ACMSTREAMHEADER_STATUSF_
DONE
|
ACMSTREAMHEADER_STATUSF_
INQUEUE
|
ACMSTREAMHEADER_STATUSF_PREPARED
);
padsh
->
fdwStatus
&=
~
(
ACMSTREAMHEADER_STATUSF_INQUEUE
|
ACMSTREAMHEADER_STATUSF_PREPARED
);
}
TRACE
(
"=> (%d)
\n
"
,
ret
);
return
ret
;
...
...
This diff is collapsed.
Click to expand it.
dlls/msacm32/tests/msacm.c
+
85
−
2
View file @
3cb2ddfd
...
...
@@ -454,7 +454,7 @@ static void check_count(UINT uMetric)
trace
(
"%s: %u
\n
"
,
get_metric
(
uMetric
),
dwMetric
);
}
static
void
msacm
_tests
(
void
)
static
void
driver
_tests
(
void
)
{
MMRESULT
rc
;
DWORD
dwACMVersion
=
acmGetVersion
();
...
...
@@ -488,7 +488,90 @@ static void msacm_tests(void)
rc
,
MMSYSERR_NOERROR
);
}
static
void
test_prepareheader
(
void
)
{
HACMSTREAM
has
;
ADPCMWAVEFORMAT
*
src
;
WAVEFORMATEX
dst
;
MMRESULT
mr
;
ACMSTREAMHEADER
hdr
;
BYTE
buf
[
sizeof
(
WAVEFORMATEX
)
+
32
],
pcm
[
512
],
input
[
512
];
ADPCMCOEFSET
*
coef
;
src
=
(
ADPCMWAVEFORMAT
*
)
buf
;
coef
=
src
->
aCoef
;
src
->
wfx
.
cbSize
=
32
;
src
->
wfx
.
wFormatTag
=
WAVE_FORMAT_ADPCM
;
src
->
wfx
.
nSamplesPerSec
=
22050
;
src
->
wfx
.
wBitsPerSample
=
4
;
src
->
wfx
.
nChannels
=
1
;
src
->
wfx
.
nBlockAlign
=
512
;
src
->
wfx
.
nAvgBytesPerSec
=
11025
;
src
->
wSamplesPerBlock
=
0x3f4
;
src
->
wNumCoef
=
7
;
coef
[
0
].
iCoef1
=
0x0100
;
coef
[
0
].
iCoef2
=
0x0000
;
coef
[
1
].
iCoef1
=
0x0200
;
coef
[
1
].
iCoef2
=
0xff00
;
coef
[
2
].
iCoef1
=
0x0000
;
coef
[
2
].
iCoef2
=
0x0000
;
coef
[
3
].
iCoef1
=
0x00c0
;
coef
[
3
].
iCoef2
=
0x0040
;
coef
[
4
].
iCoef1
=
0x00f0
;
coef
[
4
].
iCoef2
=
0x0000
;
coef
[
5
].
iCoef1
=
0x01cc
;
coef
[
5
].
iCoef2
=
0xff30
;
coef
[
6
].
iCoef1
=
0x0188
;
coef
[
6
].
iCoef2
=
0xff18
;
dst
.
cbSize
=
0
;
dst
.
wFormatTag
=
WAVE_FORMAT_PCM
;
dst
.
nSamplesPerSec
=
22050
;
dst
.
wBitsPerSample
=
8
;
dst
.
nChannels
=
1
;
dst
.
nBlockAlign
=
dst
.
wBitsPerSample
*
dst
.
nChannels
/
8
;
dst
.
nAvgBytesPerSec
=
dst
.
nSamplesPerSec
*
dst
.
nBlockAlign
;
mr
=
acmStreamOpen
(
&
has
,
NULL
,
(
WAVEFORMATEX
*
)
src
,
&
dst
,
NULL
,
0
,
0
,
0
);
ok
(
mr
==
MMSYSERR_NOERROR
,
"open failed: 0x%x
\n
"
,
mr
);
memset
(
&
hdr
,
0
,
sizeof
(
hdr
));
hdr
.
cbStruct
=
sizeof
(
hdr
);
hdr
.
pbSrc
=
input
;
hdr
.
cbSrcLength
=
sizeof
(
input
);
hdr
.
pbDst
=
pcm
;
hdr
.
cbDstLength
=
sizeof
(
pcm
);
mr
=
acmStreamPrepareHeader
(
has
,
&
hdr
,
0
);
ok
(
mr
==
MMSYSERR_NOERROR
,
"prepare failed: 0x%x
\n
"
,
mr
);
ok
(
hdr
.
fdwStatus
==
ACMSTREAMHEADER_STATUSF_PREPARED
,
"header wasn't prepared: 0x%x
\n
"
,
hdr
.
fdwStatus
);
mr
=
acmStreamUnprepareHeader
(
has
,
&
hdr
,
0
);
ok
(
mr
==
MMSYSERR_NOERROR
,
"unprepare failed: 0x%x
\n
"
,
mr
);
ok
(
hdr
.
fdwStatus
==
0
,
"header wasn't unprepared: 0x%x
\n
"
,
hdr
.
fdwStatus
);
memset
(
&
hdr
,
0
,
sizeof
(
hdr
));
hdr
.
cbStruct
=
sizeof
(
hdr
);
hdr
.
pbSrc
=
input
;
hdr
.
cbSrcLength
=
sizeof
(
input
);
hdr
.
pbDst
=
pcm
;
hdr
.
cbDstLength
=
sizeof
(
pcm
);
hdr
.
fdwStatus
=
ACMSTREAMHEADER_STATUSF_DONE
;
mr
=
acmStreamPrepareHeader
(
has
,
&
hdr
,
0
);
ok
(
mr
==
MMSYSERR_NOERROR
,
"prepare failed: 0x%x
\n
"
,
mr
);
ok
(
hdr
.
fdwStatus
==
(
ACMSTREAMHEADER_STATUSF_PREPARED
|
ACMSTREAMHEADER_STATUSF_DONE
),
"header wasn't prepared: 0x%x
\n
"
,
hdr
.
fdwStatus
);
mr
=
acmStreamUnprepareHeader
(
has
,
&
hdr
,
0
);
ok
(
mr
==
MMSYSERR_NOERROR
,
"unprepare failed: 0x%x
\n
"
,
mr
);
ok
(
hdr
.
fdwStatus
==
ACMSTREAMHEADER_STATUSF_DONE
,
"header wasn't unprepared: 0x%x
\n
"
,
hdr
.
fdwStatus
);
mr
=
acmStreamClose
(
has
,
0
);
ok
(
mr
==
MMSYSERR_NOERROR
,
"close failed: 0x%x
\n
"
,
mr
);
}
START_TEST
(
msacm
)
{
msacm_tests
();
driver_tests
();
test_prepareheader
();
}
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