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
86069716
Commit
86069716
authored
May 21, 2001
by
Eric Pouech
Committed by
Alexandre Julliard
May 21, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed open requests in case of error (if the physical device failed to
open, the ACM stream was left opened). Added mapping search for waveIn devices.
parent
7a9ddd4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
13 deletions
+42
-13
wavemap.c
dlls/winmm/wavemap/wavemap.c
+42
-13
No files found.
dlls/winmm/wavemap/wavemap.c
View file @
86069716
...
...
@@ -93,12 +93,20 @@ static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
/* destination is always PCM, so the formulas below apply */
lpwfx
->
nBlockAlign
=
(
lpwfx
->
nChannels
*
lpwfx
->
wBitsPerSample
)
/
8
;
lpwfx
->
nAvgBytesPerSec
=
lpwfx
->
nSamplesPerSec
*
lpwfx
->
nBlockAlign
;
ret
=
acmStreamOpen
(
&
wom
->
hAcmStream
,
0
,
lpDesc
->
lpFormat
,
lpwfx
,
NULL
,
0L
,
0L
,
(
dwFlags
&
WAVE_FORMAT_QUERY
)
?
ACM_STREAMOPENF_QUERY
:
0L
);
if
(
ret
!=
MMSYSERR_NOERROR
)
return
ret
;
return
waveOutOpen
(
&
wom
->
hInnerWave
,
idx
,
lpwfx
,
(
DWORD
)
wodCallback
,
(
DWORD
)
wom
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
);
if
(
dwFlags
&
WAVE_FORMAT_QUERY
)
{
ret
=
acmStreamOpen
(
NULL
,
0
,
lpDesc
->
lpFormat
,
lpwfx
,
NULL
,
0L
,
0L
,
ACM_STREAMOPENF_QUERY
);
}
else
{
ret
=
acmStreamOpen
(
&
wom
->
hAcmStream
,
0
,
lpDesc
->
lpFormat
,
lpwfx
,
NULL
,
0L
,
0L
,
0L
);
}
if
(
ret
==
MMSYSERR_NOERROR
)
{
ret
=
waveOutOpen
(
&
wom
->
hInnerWave
,
idx
,
lpwfx
,
(
DWORD
)
wodCallback
,
(
DWORD
)
wom
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
);
if
(
ret
!=
MMSYSERR_NOERROR
&&
!
(
dwFlags
&
WAVE_FORMAT_QUERY
))
{
acmStreamClose
(
wom
->
hAcmStream
,
0
);
wom
->
hAcmStream
=
0
;
}
}
return
ret
;
}
static
DWORD
wodOpen
(
LPDWORD
lpdwUser
,
LPWAVEOPENDESC
lpDesc
,
DWORD
dwFlags
)
...
...
@@ -140,6 +148,18 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
for
(
i
=
0
;
i
<
nd
;
i
++
)
{
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
44100
,
16
);
TRY
(
22050
,
16
);
TRY
(
11025
,
16
);
/* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */
wfx
.
nChannels
^=
3
;
TRY
(
44100
,
16
);
TRY
(
22050
,
16
);
TRY
(
11025
,
16
);
/* first try with same stereo/mono option as source */
wfx
.
nChannels
=
lpDesc
->
lpFormat
->
nChannels
;
TRY
(
44100
,
8
);
TRY
(
22050
,
8
);
TRY
(
11025
,
8
);
...
...
@@ -464,12 +484,20 @@ static DWORD widOpenHelper(WAVEMAPDATA* wim, UINT idx,
/* source is always PCM, so the formulas below apply */
lpwfx
->
nBlockAlign
=
(
lpwfx
->
nChannels
*
lpwfx
->
wBitsPerSample
)
/
8
;
lpwfx
->
nAvgBytesPerSec
=
lpwfx
->
nSamplesPerSec
*
lpwfx
->
nBlockAlign
;
ret
=
acmStreamOpen
(
&
wim
->
hAcmStream
,
0
,
lpwfx
,
lpDesc
->
lpFormat
,
NULL
,
0L
,
0L
,
(
dwFlags
&
WAVE_FORMAT_QUERY
)
?
ACM_STREAMOPENF_QUERY
:
0L
);
if
(
ret
!=
MMSYSERR_NOERROR
)
return
ret
;
return
waveInOpen
(
&
wim
->
hInnerWave
,
idx
,
lpwfx
,
(
DWORD
)
widCallback
,
(
DWORD
)
wim
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
);
if
(
dwFlags
&
WAVE_FORMAT_QUERY
)
{
ret
=
acmStreamOpen
(
NULL
,
0
,
lpwfx
,
lpDesc
->
lpFormat
,
NULL
,
0L
,
0L
,
ACM_STREAMOPENF_QUERY
);
}
else
{
ret
=
acmStreamOpen
(
&
wim
->
hAcmStream
,
0
,
lpwfx
,
lpDesc
->
lpFormat
,
NULL
,
0L
,
0L
,
0L
);
}
if
(
ret
==
MMSYSERR_NOERROR
)
{
ret
=
waveInOpen
(
&
wim
->
hInnerWave
,
idx
,
lpwfx
,
(
DWORD
)
widCallback
,
(
DWORD
)
wim
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
);
if
(
ret
!=
MMSYSERR_NOERROR
&&
!
(
dwFlags
&
WAVE_FORMAT_QUERY
))
{
acmStreamClose
(
wim
->
hAcmStream
,
0
);
wim
->
hAcmStream
=
0
;
}
}
return
ret
;
}
static
DWORD
widOpen
(
LPDWORD
lpdwUser
,
LPWAVEOPENDESC
lpDesc
,
DWORD
dwFlags
)
...
...
@@ -479,7 +507,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
WAVEMAPDATA
*
wim
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
WAVEFORMATEX
wfx
;
TRACE
(
"(%p %p %08lx
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
TRACE
(
"(%p %p %08lx
)
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
if
(
!
wim
)
return
MMSYSERR_NOMEM
;
...
...
@@ -528,6 +556,7 @@ found:
}
else
{
*
lpdwUser
=
(
DWORD
)
wim
;
}
TRACE
(
"Ok (stream=%08lx)
\n
"
,
(
DWORD
)
wim
->
hAcmStream
);
return
MMSYSERR_NOERROR
;
}
...
...
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