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
Zsolt Vadász
wine
Commits
fdb7d53f
Commit
fdb7d53f
authored
16 years ago
by
Stefano Guidoni
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
imaadp32: Fixed adpcm_FormatSuggest.
parent
c7fb665a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/imaadp32.acm/imaadp32.c
+30
-6
30 additions, 6 deletions
dlls/imaadp32.acm/imaadp32.c
with
30 additions
and
6 deletions
dlls/imaadp32.acm/imaadp32.c
+
30
−
6
View file @
fdb7d53f
...
...
@@ -123,6 +123,30 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx)
return
0xFFFFFFFF
;
}
static
void
init_wfx_ima_adpcm
(
IMAADPCMWAVEFORMAT
*
awfx
/*, DWORD nba*/
)
{
register
WAVEFORMATEX
*
pwfx
=
&
awfx
->
wfx
;
/* we assume wFormatTag, nChannels, nSamplesPerSec and wBitsPerSample
* have been initialized... */
if
(
pwfx
->
wFormatTag
!=
WAVE_FORMAT_IMA_ADPCM
)
{
FIXME
(
"wrong FT
\n
"
);
return
;}
if
(
ADPCM_GetFormatIndex
(
pwfx
)
==
0xFFFFFFFF
)
{
FIXME
(
"wrong fmt
\n
"
);
return
;}
switch
(
pwfx
->
nSamplesPerSec
)
{
case
8000
:
pwfx
->
nBlockAlign
=
256
*
pwfx
->
nChannels
;
break
;
case
11025
:
pwfx
->
nBlockAlign
=
256
*
pwfx
->
nChannels
;
break
;
case
22050
:
pwfx
->
nBlockAlign
=
512
*
pwfx
->
nChannels
;
break
;
case
44100
:
pwfx
->
nBlockAlign
=
1024
*
pwfx
->
nChannels
;
break
;
default:
/*pwfx->nBlockAlign = nba;*/
break
;
}
pwfx
->
cbSize
=
sizeof
(
WORD
);
awfx
->
wSamplesPerBlock
=
(
pwfx
->
nBlockAlign
-
(
4
*
pwfx
->
nChannels
)
*
2
)
/
pwfx
->
nChannels
+
1
;
pwfx
->
nAvgBytesPerSec
=
(
pwfx
->
nSamplesPerSec
*
pwfx
->
nBlockAlign
)
/
awfx
->
wSamplesPerBlock
;
}
/***********************************************************************
* R16
*
...
...
@@ -612,6 +636,7 @@ static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
/* some tests ... */
if
(
adfs
->
cbwfxSrc
<
sizeof
(
PCMWAVEFORMAT
)
||
adfs
->
cbwfxDst
<
sizeof
(
PCMWAVEFORMAT
)
||
adfs
->
pwfxSrc
->
wFormatTag
==
adfs
->
pwfxDst
->
wFormatTag
||
ADPCM_GetFormatIndex
(
adfs
->
pwfxSrc
)
==
0xFFFFFFFF
)
return
ACMERR_NOTPOSSIBLE
;
/* FIXME: should do those tests against the real size (according to format tag */
...
...
@@ -636,22 +661,21 @@ static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
adfs
->
pwfxDst
->
wFormatTag
=
WAVE_FORMAT_PCM
;
}
/* check if result is ok */
if
(
ADPCM_GetFormatIndex
(
adfs
->
pwfxDst
)
==
0xFFFFFFFF
)
return
ACMERR_NOTPOSSIBLE
;
/* recompute other values */
switch
(
adfs
->
pwfxDst
->
wFormatTag
)
{
case
WAVE_FORMAT_PCM
:
adfs
->
pwfxDst
->
nBlockAlign
=
(
adfs
->
pwfxDst
->
nChannels
*
adfs
->
pwfxDst
->
wBitsPerSample
)
/
8
;
adfs
->
pwfxDst
->
nAvgBytesPerSec
=
adfs
->
pwfxDst
->
nSamplesPerSec
*
adfs
->
pwfxDst
->
nBlockAlign
;
/* check if result is ok */
if
(
ADPCM_GetFormatIndex
(
adfs
->
pwfxDst
)
==
0xFFFFFFFF
)
return
ACMERR_NOTPOSSIBLE
;
break
;
case
WAVE_FORMAT_IMA_ADPCM
:
adfs
->
pwfxDst
->
nBlockAlign
=
1024
;
init_wfx_ima_adpcm
((
IMAADPCMWAVEFORMAT
*
)
adfs
->
pwfxDst
)
;
/* FIXME: not handling header overhead */
adfs
->
pwfxDst
->
nAvgBytesPerSec
=
((
adfs
->
pwfxDst
->
nSamplesPerSec
*
4
)
/
8
)
*
adfs
->
pwfxSrc
->
nChannels
;
((
IMAADPCMWAVEFORMAT
*
)
adfs
->
pwfxDst
)
->
wSamplesPerBlock
=
(
1024
-
4
*
adfs
->
pwfxSrc
->
nChannels
)
*
(
2
/
adfs
->
pwfxSrc
->
nChannels
)
+
1
;
TRACE
(
"setting spb=%u
\n
"
,
((
IMAADPCMWAVEFORMAT
*
)
adfs
->
pwfxDst
)
->
wSamplesPerBlock
);
/* check if result is ok */
if
(
ADPCM_GetFormatIndex
(
adfs
->
pwfxDst
)
==
0xFFFFFFFF
)
return
ACMERR_NOTPOSSIBLE
;
break
;
default:
FIXME
(
"
\n
"
);
...
...
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