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
0924ddd2
Commit
0924ddd2
authored
Feb 01, 2009
by
Vincent Pelletier
Committed by
Alexandre Julliard
Feb 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msadp32.acm: Block align the adpcm extra data.
Based heavily on Stefano Guidoni's patch.
parent
8ee698c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
8 deletions
+29
-8
msadp32.c
dlls/msadp32.acm/msadp32.c
+29
-8
No files found.
dlls/msadp32.acm/msadp32.c
View file @
0924ddd2
...
...
@@ -618,6 +618,9 @@ static LRESULT ADPCM_StreamClose(PACMDRVSTREAMINSTANCE adsi)
*/
static
LRESULT
ADPCM_StreamSize
(
const
ACMDRVSTREAMINSTANCE
*
adsi
,
PACMDRVSTREAMSIZE
adss
)
{
DWORD
nblocks
;
WORD
wSamplesPerBlock
;
/* wSamplesPerBlock formula comes from MSDN ADPCMWAVEFORMAT page.*/
switch
(
adss
->
fdwSize
)
{
case
ACM_STREAMSIZEF_DESTINATION
:
...
...
@@ -625,14 +628,20 @@ static LRESULT ADPCM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMS
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_PCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_ADPCM
)
{
/* don't take block overhead into account, doesn't matter too much */
adss
->
cbSrcLength
=
adss
->
cbDstLength
*
4
;
wSamplesPerBlock
=
adsi
->
pwfxDst
->
nBlockAlign
*
2
/
adsi
->
pwfxDst
->
nChannels
-
12
;
nblocks
=
adss
->
cbDstLength
/
adsi
->
pwfxDst
->
nBlockAlign
;
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
adss
->
cbSrcLength
=
nblocks
*
adsi
->
pwfxSrc
->
nBlockAlign
*
wSamplesPerBlock
;
}
else
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_ADPCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
FIXME
(
"misses the block header overhead
\n
"
);
adss
->
cbSrcLength
=
256
+
adss
->
cbDstLength
/
4
;
wSamplesPerBlock
=
adsi
->
pwfxSrc
->
nBlockAlign
*
2
/
adsi
->
pwfxSrc
->
nChannels
-
12
;
nblocks
=
adss
->
cbDstLength
/
(
adsi
->
pwfxDst
->
nBlockAlign
*
wSamplesPerBlock
);
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
adss
->
cbSrcLength
=
nblocks
*
adsi
->
pwfxSrc
->
nBlockAlign
;
}
else
{
...
...
@@ -644,14 +653,26 @@ static LRESULT ADPCM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMS
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_PCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_ADPCM
)
{
FIXME
(
"misses the block header overhead
\n
"
);
adss
->
cbDstLength
=
256
+
adss
->
cbSrcLength
/
4
;
wSamplesPerBlock
=
adsi
->
pwfxDst
->
nBlockAlign
*
2
/
adsi
->
pwfxDst
->
nChannels
-
12
;
nblocks
=
adss
->
cbSrcLength
/
(
adsi
->
pwfxSrc
->
nBlockAlign
*
wSamplesPerBlock
);
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
if
(
adss
->
cbSrcLength
%
(
adsi
->
pwfxSrc
->
nBlockAlign
*
wSamplesPerBlock
))
/* Round block count up. */
nblocks
++
;
adss
->
cbDstLength
=
nblocks
*
adsi
->
pwfxSrc
->
nBlockAlign
;
}
else
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_ADPCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
/* don't take block overhead into account, doesn't matter too much */
adss
->
cbDstLength
=
adss
->
cbSrcLength
*
4
;
wSamplesPerBlock
=
adsi
->
pwfxSrc
->
nBlockAlign
*
2
/
adsi
->
pwfxSrc
->
nChannels
-
12
;
nblocks
=
adss
->
cbSrcLength
/
adsi
->
pwfxSrc
->
nBlockAlign
;
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
if
(
adss
->
cbSrcLength
%
adsi
->
pwfxSrc
->
nBlockAlign
)
/* Round block count up. */
nblocks
++
;
adss
->
cbDstLength
=
nblocks
*
adsi
->
pwfxSrc
->
nBlockAlign
*
wSamplesPerBlock
;
}
else
{
...
...
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