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
9ef4a009
Commit
9ef4a009
authored
Jan 04, 2012
by
Jörg Höhle
Committed by
Alexandre Julliard
Jan 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Fix conversion to MMTIME, avoid floating point arithmetic.
parent
8e755152
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
21 deletions
+14
-21
wave.c
dlls/winmm/tests/wave.c
+4
-4
waveform.c
dlls/winmm/waveform.c
+10
-17
No files found.
dlls/winmm/tests/wave.c
View file @
9ef4a009
...
...
@@ -471,10 +471,10 @@ DWORD time_to_bytes(LPMMTIME mmtime, LPWAVEFORMATEX pwfx)
else
if
(
mmtime
->
wType
==
TIME_MS
)
return
mmtime
->
u
.
ms
*
pwfx
->
nAvgBytesPerSec
/
1000
;
else
if
(
mmtime
->
wType
==
TIME_SMPTE
)
return
((
mmtime
->
u
.
smpte
.
hour
*
60
.
0
*
60
.
0
)
+
(
mmtime
->
u
.
smpte
.
min
*
60
.
0
)
+
(
mmtime
->
u
.
smpte
.
sec
)
+
(
mmtime
->
u
.
smpte
.
frame
/
30
.
0
))
*
pwfx
->
nAvgBytesPerSec
;
return
((
mmtime
->
u
.
smpte
.
hour
*
60
*
6
0
)
+
(
mmtime
->
u
.
smpte
.
min
*
60
)
+
(
mmtime
->
u
.
smpte
.
sec
)
)
*
pwfx
->
nAvgBytesPerSec
+
mmtime
->
u
.
smpte
.
frame
*
pwfx
->
nAvgBytesPerSec
/
30
;
trace
(
"FIXME: time_to_bytes() type not supported
\n
"
);
return
-
1
;
...
...
dlls/winmm/waveform.c
View file @
9ef4a009
...
...
@@ -1723,32 +1723,25 @@ static MMRESULT WINMM_FramesToMMTime(MMTIME *time, UINT32 played_frames,
time
->
u
.
sample
=
played_frames
;
return
MMSYSERR_NOERROR
;
case
TIME_MS
:
time
->
u
.
ms
=
(
DWORD
)((
played_frames
/
(
double
)
sample_rate
)
*
1000
)
;
time
->
u
.
ms
=
(
UINT64
)
played_frames
*
1000
/
sample_rate
;
return
MMSYSERR_NOERROR
;
case
TIME_SMPTE
:
time
->
u
.
smpte
.
fps
=
30
;
if
(
played_frames
>=
sample_rate
){
time
->
u
.
smpte
.
sec
=
played_frames
/
(
double
)
sample_rate
;
time
->
u
.
smpte
.
min
=
time
->
u
.
smpte
.
sec
/
60
;
time
->
u
.
smpte
.
hour
=
time
->
u
.
smpte
.
min
/
60
;
time
->
u
.
smpte
.
sec
%=
60
;
time
->
u
.
smpte
.
min
%=
60
;
played_frames
%=
sample_rate
;
}
else
{
time
->
u
.
smpte
.
sec
=
0
;
time
->
u
.
smpte
.
min
=
0
;
time
->
u
.
smpte
.
hour
=
0
;
}
time
->
u
.
smpte
.
frame
=
(
played_frames
/
(
double
)
sample_rate
)
*
30
;
played_frames
+=
sample_rate
/
time
->
u
.
smpte
.
fps
-
1
;
/* round up */
time
->
u
.
smpte
.
frame
=
(
played_frames
%
sample_rate
)
*
time
->
u
.
smpte
.
fps
/
sample_rate
;
played_frames
/=
sample_rate
;
/* yields seconds */
time
->
u
.
smpte
.
sec
=
played_frames
%
60
;
played_frames
/=
60
;
time
->
u
.
smpte
.
min
=
played_frames
%
60
;
time
->
u
.
smpte
.
hour
=
played_frames
/
60
;
return
MMSYSERR_NOERROR
;
case
TIME_BYTES
:
default:
time
->
wType
=
TIME_BYTES
;
/* fall through */
case
TIME_BYTES
:
time
->
u
.
cb
=
played_frames
*
bytes_per_frame
;
return
MMSYSERR_NOERROR
;
}
return
MMSYSERR_ERROR
;
}
static
LRESULT
WINMM_GetPosition
(
HWAVE
hwave
,
MMTIME
*
time
)
...
...
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