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
60f21c3d
Commit
60f21c3d
authored
Oct 07, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 07, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of recursion in sub device opening.
parent
b4ba9fa7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
wavemap.c
dlls/winmm/wavemap/wavemap.c
+19
-6
No files found.
dlls/winmm/wavemap/wavemap.c
View file @
60f21c3d
...
...
@@ -128,7 +128,6 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
UINT
ndlo
,
ndhi
;
UINT
i
;
WAVEMAPDATA
*
wom
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
WAVEFORMATEX
wfx
;
TRACE
(
"(%p %p %08lx
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
...
...
@@ -155,18 +154,21 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
* level, this will be done transparently
*/
if
(
waveOutOpen
(
&
wom
->
hInnerWave
,
i
,
lpDesc
->
lpFormat
,
(
DWORD
)
wodCallback
,
(
DWORD
)
wom
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
)
==
MMSYSERR_NOERROR
)
{
(
DWORD
)
wom
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
|
WAVE_FORMAT_DIRECT
)
==
MMSYSERR_NOERROR
)
{
wom
->
hAcmStream
=
0
;
goto
found
;
}
}
if
((
dwFlags
&
WAVE_FORMAT_DIRECT
)
==
0
)
{
WAVEFORMATEX
wfx
;
wfx
.
wFormatTag
=
WAVE_FORMAT_PCM
;
wfx
.
cbSize
=
0
;
/* normally, this field is not used for PCM format, just in case */
/* try some ACM stuff */
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
if (wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags) == MMSYSERR_NOERROR) goto found;
if (wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags
| WAVE_FORMAT_DIRECT
) == MMSYSERR_NOERROR) goto found;
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
...
...
@@ -194,6 +196,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
TRY
(
11025
,
8
);
}
#undef TRY
}
HeapFree
(
GetProcessHeap
(),
0
,
wom
);
return
MMSYSERR_ALLOCATED
;
...
...
@@ -239,6 +242,11 @@ static DWORD wodWrite(WAVEMAPDATA* wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwParam2)
return
MMSYSERR_ERROR
;
lpWaveHdrDst
=
(
LPWAVEHDR
)((
LPSTR
)
ash
+
sizeof
(
ACMSTREAMHEADER
));
if
(
ash
->
cbSrcLength
>
ash
->
cbSrcLengthUsed
)
FIXME
(
"Not all src buffer has been written, expect bogus sound
\n
"
);
else
if
(
ash
->
cbSrcLength
<
ash
->
cbSrcLengthUsed
)
ERR
(
"CoDec has read more data than it is allowed to
\n
"
);
if
(
ash
->
cbDstLengthUsed
==
0
)
{
/* something went wrong in decoding */
...
...
@@ -536,7 +544,6 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
UINT
ndlo
,
ndhi
;
UINT
i
;
WAVEMAPDATA
*
wim
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
WAVEFORMATEX
wfx
;
TRACE
(
"(%p %p %08lx)
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
...
...
@@ -561,17 +568,22 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
if
(
waveInOpen
(
&
wim
->
hInnerWave
,
i
,
lpDesc
->
lpFormat
,
(
DWORD
)
widCallback
,
(
DWORD
)
wim
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
)
==
MMSYSERR_NOERROR
)
{
(
DWORD
)
wim
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
|
WAVE_FORMAT_DIRECT
)
==
MMSYSERR_NOERROR
)
{
wim
->
hAcmStream
=
0
;
goto
found
;
}
}
if
((
dwFlags
&
WAVE_FORMAT_DIRECT
)
==
0
)
{
WAVEFORMATEX
wfx
;
wfx
.
wFormatTag
=
WAVE_FORMAT_PCM
;
wfx
.
cbSize
=
0
;
/* normally, this field is not used for PCM format, just in case */
/* try some ACM stuff */
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
if (widOpenHelper(wim, i, lpDesc, &wfx, dwFlags) == MMSYSERR_NOERROR) goto found;
if (widOpenHelper(wim, i, lpDesc, &wfx, dwFlags
| WAVE_FORMAT_DIRECT
) == MMSYSERR_NOERROR) goto found;
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
...
...
@@ -587,6 +599,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
TRY
(
11025
,
8
);
}
#undef TRY
}
HeapFree
(
GetProcessHeap
(),
0
,
wim
);
return
MMSYSERR_ALLOCATED
;
...
...
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