Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7efe3ff0
Commit
7efe3ff0
authored
Oct 31, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 31, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return correct values for wave(In|Out)GetPosition even if playing non
PCM files.
parent
7656b145
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
wavemap.c
dlls/winmm/wavemap/wavemap.c
+20
-8
No files found.
dlls/winmm/wavemap/wavemap.c
View file @
7efe3ff0
...
...
@@ -56,6 +56,9 @@ typedef struct tagWAVEMAPDATA {
DWORD
dwCallback
;
DWORD
dwClientInstance
;
DWORD
dwFlags
;
/* ratio to compute position from a PCM playback to any format */
DWORD
avgSpeedOuter
;
DWORD
avgSpeedInner
;
}
WAVEMAPDATA
;
static
BOOL
WAVEMAP_IsData
(
WAVEMAPDATA
*
wm
)
...
...
@@ -161,6 +164,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wom
->
dwFlags
=
dwFlags
;
wom
->
dwClientInstance
=
lpDesc
->
dwInstance
;
wom
->
u
.
out
.
hOuterWave
=
(
HWAVEOUT
)
lpDesc
->
hWave
;
wom
->
avgSpeedOuter
=
wom
->
avgSpeedInner
=
lpDesc
->
lpFormat
->
nAvgBytesPerSec
;
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* if no ACM stuff is involved, no need to handle callbacks at this
...
...
@@ -181,7 +185,8 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* try some ACM stuff */
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
if (wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT) == MMSYSERR_NOERROR) goto found;
if (wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT) == MMSYSERR_NOERROR) \
{wom->avgSpeedInner = wfx.nAvgBytesPerSec; goto found;}
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
...
...
@@ -344,9 +349,11 @@ static DWORD wodUnprepare(WAVEMAPDATA* wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwPara
static
DWORD
wodGetPosition
(
WAVEMAPDATA
*
wom
,
LPMMTIME
lpTime
,
DWORD
dwParam2
)
{
if
(
wom
->
hAcmStream
)
FIXME
(
"No position conversion done for PCM => non-PCM, returning PCM position
\n
"
);
return
waveOutGetPosition
(
wom
->
u
.
out
.
hInnerWave
,
lpTime
,
dwParam2
);
DWORD
val
=
waveOutGetPosition
(
wom
->
u
.
out
.
hInnerWave
,
lpTime
,
dwParam2
);
if
(
lpTime
->
wType
==
TIME_BYTES
)
val
=
MulDiv
(
val
,
wom
->
avgSpeedOuter
,
wom
->
avgSpeedInner
);
/* other time types don't require conversion */
return
val
;
}
static
DWORD
wodGetDevCaps
(
UINT
wDevID
,
WAVEMAPDATA
*
wom
,
LPWAVEOUTCAPSA
lpWaveCaps
,
DWORD
dwParam2
)
...
...
@@ -579,6 +586,8 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
ndlo
=
0
;
}
wim
->
avgSpeedOuter
=
wim
->
avgSpeedInner
=
lpDesc
->
lpFormat
->
nAvgBytesPerSec
;
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
if
(
waveInOpen
(
&
wim
->
u
.
in
.
hInnerWave
,
i
,
lpDesc
->
lpFormat
,
(
DWORD
)
widCallback
,
(
DWORD
)
wim
,
(
dwFlags
&
~
CALLBACK_TYPEMASK
)
|
CALLBACK_FUNCTION
|
WAVE_FORMAT_DIRECT
)
==
MMSYSERR_NOERROR
)
{
...
...
@@ -596,7 +605,8 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* try some ACM stuff */
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
if (widOpenHelper(wim, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT) == MMSYSERR_NOERROR) goto found;
if (widOpenHelper(wim, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT) == MMSYSERR_NOERROR) \
{wim->avgSpeedInner = wfx.nAvgBytesPerSec; goto found;}
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* first try with same stereo/mono option as source */
...
...
@@ -733,9 +743,11 @@ static DWORD widUnprepare(WAVEMAPDATA* wim, LPWAVEHDR lpWaveHdrDst, DWORD dwPara
static
DWORD
widGetPosition
(
WAVEMAPDATA
*
wim
,
LPMMTIME
lpTime
,
DWORD
dwParam2
)
{
if
(
wim
->
hAcmStream
)
FIXME
(
"No position conversion done for PCM => non-PCM, returning PCM position
\n
"
);
return
waveInGetPosition
(
wim
->
u
.
in
.
hInnerWave
,
lpTime
,
dwParam2
);
DWORD
val
=
waveInGetPosition
(
wim
->
u
.
in
.
hInnerWave
,
lpTime
,
dwParam2
);
if
(
lpTime
->
wType
==
TIME_BYTES
)
val
=
MulDiv
(
val
,
wim
->
avgSpeedOuter
,
wim
->
avgSpeedInner
);
/* other time types don't require conversion */
return
val
;
}
static
DWORD
widGetDevCaps
(
UINT
wDevID
,
WAVEMAPDATA
*
wim
,
LPWAVEINCAPSA
lpWaveCaps
,
DWORD
dwParam2
)
...
...
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