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
c262d5b6
Commit
c262d5b6
authored
Feb 09, 2009
by
Stefano Guidoni
Committed by
Alexandre Julliard
Feb 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msadp32: ADPCM allows other sample rates other than 8000, 11025, 22050 and 44100.
parent
fbcc1875
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
msadp32.c
dlls/msadp32.acm/msadp32.c
+24
-4
No files found.
dlls/msadp32.acm/msadp32.c
View file @
c262d5b6
...
@@ -128,6 +128,25 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX* wfx)
...
@@ -128,6 +128,25 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX* wfx)
return
i
;
return
i
;
}
}
switch
(
wfx
->
wFormatTag
)
{
case
WAVE_FORMAT_PCM
:
if
(
3
>
wfx
->
nChannels
&&
wfx
->
nChannels
>
0
&&
wfx
->
nAvgBytesPerSec
==
2
*
wfx
->
nSamplesPerSec
*
wfx
->
nChannels
&&
wfx
->
nBlockAlign
==
2
*
wfx
->
nChannels
&&
wfx
->
wBitsPerSample
==
16
)
return
hi
;
break
;
case
WAVE_FORMAT_ADPCM
:
if
(
3
>
wfx
->
nChannels
&&
wfx
->
nChannels
>
0
&&
wfx
->
wBitsPerSample
==
4
&&
wfx
->
cbSize
==
32
)
return
hi
;
break
;
}
return
0xFFFFFFFF
;
return
0xFFFFFFFF
;
}
}
...
@@ -146,8 +165,8 @@ static void init_wfx_adpcm(ADPCMWAVEFORMAT* awfx)
...
@@ -146,8 +165,8 @@ static void init_wfx_adpcm(ADPCMWAVEFORMAT* awfx)
case
8000
:
pwfx
->
nBlockAlign
=
256
;
break
;
case
8000
:
pwfx
->
nBlockAlign
=
256
;
break
;
case
11025
:
pwfx
->
nBlockAlign
=
256
;
break
;
case
11025
:
pwfx
->
nBlockAlign
=
256
;
break
;
case
22050
:
pwfx
->
nBlockAlign
=
512
;
break
;
case
22050
:
pwfx
->
nBlockAlign
=
512
;
break
;
default:
case
44100
:
pwfx
->
nBlockAlign
=
1024
;
break
;
case
44100
:
pwfx
->
nBlockAlign
=
1024
;
break
;
default:
break
;
}
}
pwfx
->
cbSize
=
2
*
sizeof
(
WORD
)
+
7
*
sizeof
(
ADPCMCOEFSET
);
pwfx
->
cbSize
=
2
*
sizeof
(
WORD
)
+
7
*
sizeof
(
ADPCMCOEFSET
);
/* 7 is the size of the block head (which contains two samples) */
/* 7 is the size of the block head (which contains two samples) */
...
@@ -477,18 +496,19 @@ static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
...
@@ -477,18 +496,19 @@ static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
adfs
->
pwfxDst
->
wFormatTag
=
WAVE_FORMAT_PCM
;
adfs
->
pwfxDst
->
wFormatTag
=
WAVE_FORMAT_PCM
;
}
}
/* check if result is ok */
if
(
ADPCM_GetFormatIndex
(
adfs
->
pwfxDst
)
==
0xFFFFFFFF
)
return
ACMERR_NOTPOSSIBLE
;
/* recompute other values */
/* recompute other values */
switch
(
adfs
->
pwfxDst
->
wFormatTag
)
switch
(
adfs
->
pwfxDst
->
wFormatTag
)
{
{
case
WAVE_FORMAT_PCM
:
case
WAVE_FORMAT_PCM
:
adfs
->
pwfxDst
->
nBlockAlign
=
(
adfs
->
pwfxDst
->
nChannels
*
adfs
->
pwfxDst
->
wBitsPerSample
)
/
8
;
adfs
->
pwfxDst
->
nBlockAlign
=
(
adfs
->
pwfxDst
->
nChannels
*
adfs
->
pwfxDst
->
wBitsPerSample
)
/
8
;
adfs
->
pwfxDst
->
nAvgBytesPerSec
=
adfs
->
pwfxDst
->
nSamplesPerSec
*
adfs
->
pwfxDst
->
nBlockAlign
;
adfs
->
pwfxDst
->
nAvgBytesPerSec
=
adfs
->
pwfxDst
->
nSamplesPerSec
*
adfs
->
pwfxDst
->
nBlockAlign
;
/* check if result is ok */
if
(
ADPCM_GetFormatIndex
(
adfs
->
pwfxDst
)
==
0xFFFFFFFF
)
return
ACMERR_NOTPOSSIBLE
;
break
;
break
;
case
WAVE_FORMAT_ADPCM
:
case
WAVE_FORMAT_ADPCM
:
init_wfx_adpcm
((
ADPCMWAVEFORMAT
*
)
adfs
->
pwfxDst
);
init_wfx_adpcm
((
ADPCMWAVEFORMAT
*
)
adfs
->
pwfxDst
);
/* check if result is ok */
if
(
ADPCM_GetFormatIndex
(
adfs
->
pwfxDst
)
==
0xFFFFFFFF
)
return
ACMERR_NOTPOSSIBLE
;
break
;
break
;
default:
default:
FIXME
(
"
\n
"
);
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