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
da24dff4
Commit
da24dff4
authored
Jul 21, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Jul 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure we won't get an overflow in check_position() even if we play
longer test tones.
parent
02a8ab2f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
wave.c
dlls/winmm/tests/wave.c
+5
-4
No files found.
dlls/winmm/tests/wave.c
View file @
da24dff4
...
...
@@ -215,9 +215,11 @@ static void check_position(int device, HWAVEOUT wout, DWORD bytes, LPWAVEFORMATE
{
MMTIME
mmtime
;
DWORD
samples
;
double
duration
;
MMRESULT
rc
;
samples
=
bytes
*
8
/
pwfx
->
wBitsPerSample
/
pwfx
->
nChannels
;
samples
=
bytes
/
(
pwfx
->
wBitsPerSample
/
8
*
pwfx
->
nChannels
);
duration
=
((
double
)
samples
)
/
pwfx
->
nSamplesPerSec
;
mmtime
.
wType
=
TIME_BYTES
;
rc
=
waveOutGetPosition
(
wout
,
&
mmtime
,
sizeof
(
mmtime
));
...
...
@@ -246,9 +248,9 @@ static void check_position(int device, HWAVEOUT wout, DWORD bytes, LPWAVEFORMATE
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutGetPosition: device=%s rc=%s
\n
"
,
dev_name
(
device
),
wave_out_error
(
rc
));
if
(
mmtime
.
wType
==
TIME_MS
)
ok
(
mmtime
.
u
.
ms
==
samples
*
1000
/
pwfx
->
nSamplesPerSec
,
ok
(
mmtime
.
u
.
ms
==
floor
(
duration
*
1000
.
0
)
,
"waveOutGetPosition returned %ld ms, should be %ld
\n
"
,
mmtime
.
u
.
ms
,
samples
*
1000
/
pwfx
->
nSamplesPerSec
);
mmtime
.
u
.
ms
,
(
long
)
floor
(
duration
*
1000
.
0
)
);
else
trace
(
"TIME_MS not supported, returned %s
\n
"
,
wave_time_format
(
mmtime
.
wType
));
...
...
@@ -258,7 +260,6 @@ static void check_position(int device, HWAVEOUT wout, DWORD bytes, LPWAVEFORMATE
"waveOutGetPosition: device=%s rc=%s
\n
"
,
dev_name
(
device
),
wave_out_error
(
rc
));
if
(
mmtime
.
wType
==
TIME_SMPTE
)
{
double
duration
=
((
double
)
samples
)
/
pwfx
->
nSamplesPerSec
;
BYTE
frames
=
ceil
(
fmod
(
duration
*
mmtime
.
u
.
smpte
.
fps
,
mmtime
.
u
.
smpte
.
fps
));
ok
(
mmtime
.
u
.
smpte
.
hour
==
(
BYTE
)(
floor
(
duration
/
(
60
*
60
)))
&&
mmtime
.
u
.
smpte
.
min
==
(
BYTE
)(
fmod
(
floor
(
duration
/
60
),
60
))
&&
...
...
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