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
15ec2780
Commit
15ec2780
authored
Feb 23, 2005
by
Jeremy White
Committed by
Alexandre Julliard
Feb 23, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When we are converting from one sample rate to another, we do have to
adjust when calculating TIME_SAMPLES.
parent
ddd1c1d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
wavemap.c
dlls/winmm/wavemap/wavemap.c
+11
-2
No files found.
dlls/winmm/wavemap/wavemap.c
View file @
15ec2780
...
...
@@ -62,6 +62,9 @@ typedef struct tagWAVEMAPDATA {
/* ratio to compute position from a PCM playback to any format */
DWORD
avgSpeedOuter
;
DWORD
avgSpeedInner
;
/* channel size of inner and outer */
DWORD
nSamplesPerSecOuter
;
DWORD
nSamplesPerSecInner
;
}
WAVEMAPDATA
;
static
BOOL
WAVEMAP_IsData
(
WAVEMAPDATA
*
wm
)
...
...
@@ -177,6 +180,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wom
->
dwClientInstance
=
lpDesc
->
dwInstance
;
wom
->
u
.
out
.
hOuterWave
=
(
HWAVEOUT
)
lpDesc
->
hWave
;
wom
->
avgSpeedOuter
=
wom
->
avgSpeedInner
=
lpDesc
->
lpFormat
->
nAvgBytesPerSec
;
wom
->
nSamplesPerSecOuter
=
wom
->
nSamplesPerSecInner
=
lpDesc
->
lpFormat
->
nSamplesPerSec
;
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
/* if no ACM stuff is involved, no need to handle callbacks at this
...
...
@@ -198,7 +202,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
switch (res=wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
case MMSYSERR_NOERROR: wom->avgSpeedInner = wfx.nAvgBytesPerSec; goto found; \
case MMSYSERR_NOERROR: wom->avgSpeedInner = wfx.nAvgBytesPerSec;
wom->nSamplesPerSecInner = wfx.nSamplesPerSec;
goto found; \
case WAVERR_BADFORMAT: break; \
default: goto error; \
}
...
...
@@ -419,6 +423,8 @@ static DWORD wodGetPosition(WAVEMAPDATA* wom, LPMMTIME lpTime, DWORD dwParam2)
val
=
waveOutGetPosition
(
wom
->
u
.
out
.
hInnerWave
,
lpTime
,
dwParam2
);
if
(
lpTime
->
wType
==
TIME_BYTES
)
lpTime
->
u
.
cb
=
MulDiv
(
lpTime
->
u
.
cb
,
wom
->
avgSpeedOuter
,
wom
->
avgSpeedInner
);
if
(
lpTime
->
wType
==
TIME_SAMPLES
)
lpTime
->
u
.
cb
=
MulDiv
(
lpTime
->
u
.
cb
,
wom
->
nSamplesPerSecOuter
,
wom
->
nSamplesPerSecInner
);
/* other time types don't require conversion */
return
val
;
}
...
...
@@ -691,6 +697,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
}
wim
->
avgSpeedOuter
=
wim
->
avgSpeedInner
=
lpDesc
->
lpFormat
->
nAvgBytesPerSec
;
wim
->
nSamplesPerSecOuter
=
wim
->
nSamplesPerSecInner
=
lpDesc
->
lpFormat
->
nSamplesPerSec
;
for
(
i
=
ndlo
;
i
<
ndhi
;
i
++
)
{
if
(
waveInOpen
(
&
wim
->
u
.
in
.
hInnerWave
,
i
,
lpDesc
->
lpFormat
,
(
DWORD
)
widCallback
,
...
...
@@ -710,7 +717,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
switch (res=widOpenHelper(wim, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
case MMSYSERR_NOERROR: wim->avgSpeedInner = wfx.nAvgBytesPerSec; goto found; \
case MMSYSERR_NOERROR: wim->avgSpeedInner = wfx.nAvgBytesPerSec;
wim->nSamplesPerSecInner = wfx.nSamplesPerSec;
goto found; \
case WAVERR_BADFORMAT: break; \
default: goto error; \
}
...
...
@@ -915,6 +922,8 @@ static DWORD widGetPosition(WAVEMAPDATA* wim, LPMMTIME lpTime, DWORD dwParam2)
val
=
waveInGetPosition
(
wim
->
u
.
in
.
hInnerWave
,
lpTime
,
dwParam2
);
if
(
lpTime
->
wType
==
TIME_BYTES
)
lpTime
->
u
.
cb
=
MulDiv
(
lpTime
->
u
.
cb
,
wim
->
avgSpeedOuter
,
wim
->
avgSpeedInner
);
if
(
lpTime
->
wType
==
TIME_SAMPLES
)
lpTime
->
u
.
cb
=
MulDiv
(
lpTime
->
u
.
cb
,
wim
->
nSamplesPerSecOuter
,
wim
->
nSamplesPerSecInner
);
/* other time types don't require conversion */
return
val
;
}
...
...
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