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
fdb7d53f
Commit
fdb7d53f
authored
Mar 01, 2009
by
Stefano Guidoni
Committed by
Alexandre Julliard
Mar 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imaadp32: Fixed adpcm_FormatSuggest.
parent
c7fb665a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
6 deletions
+30
-6
imaadp32.c
dlls/imaadp32.acm/imaadp32.c
+30
-6
No files found.
dlls/imaadp32.acm/imaadp32.c
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
"
);
...
...
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