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
a2eec346
Commit
a2eec346
authored
Aug 04, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Aug 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Use a mftime_to_seconds() helper to convert time.
parent
613d7b09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
main.c
dlls/mfmediaengine/main.c
+8
-5
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+0
-1
No files found.
dlls/mfmediaengine/main.c
View file @
a2eec346
...
@@ -63,6 +63,12 @@ static BOOL mf_array_reserve(void **elements, size_t *capacity, size_t count, si
...
@@ -63,6 +63,12 @@ static BOOL mf_array_reserve(void **elements, size_t *capacity, size_t count, si
return
TRUE
;
return
TRUE
;
}
}
/* Convert 100ns to seconds */
static
double
mftime_to_seconds
(
MFTIME
time
)
{
return
(
double
)
time
/
10000000
.
0
;
}
enum
media_engine_mode
enum
media_engine_mode
{
{
MEDIA_ENGINE_INVALID
,
MEDIA_ENGINE_INVALID
,
...
@@ -1248,10 +1254,7 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
...
@@ -1248,10 +1254,7 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
/* Assume live source if duration was not provided. */
/* Assume live source if duration was not provided. */
if
(
SUCCEEDED
(
IMFPresentationDescriptor_GetUINT64
(
pd
,
&
MF_PD_DURATION
,
&
duration
)))
if
(
SUCCEEDED
(
IMFPresentationDescriptor_GetUINT64
(
pd
,
&
MF_PD_DURATION
,
&
duration
)))
{
engine
->
duration
=
mftime_to_seconds
(
duration
);
/* Convert 100ns to seconds. */
engine
->
duration
=
duration
/
10000000
;
}
else
else
engine
->
duration
=
INFINITY
;
engine
->
duration
=
INFINITY
;
...
@@ -1749,7 +1752,7 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface)
...
@@ -1749,7 +1752,7 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface)
}
}
else
if
(
SUCCEEDED
(
IMFPresentationClock_GetTime
(
engine
->
clock
,
&
clocktime
)))
else
if
(
SUCCEEDED
(
IMFPresentationClock_GetTime
(
engine
->
clock
,
&
clocktime
)))
{
{
ret
=
(
double
)
clocktime
/
10000000
.
0
;
ret
=
mftime_to_seconds
(
clocktime
)
;
}
}
LeaveCriticalSection
(
&
engine
->
cs
);
LeaveCriticalSection
(
&
engine
->
cs
);
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
a2eec346
...
@@ -1961,7 +1961,6 @@ static void test_GetDuration(void)
...
@@ -1961,7 +1961,6 @@ static void test_GetDuration(void)
ok
(
!
res
,
"Unexpected res %#lx.
\n
"
,
res
);
ok
(
!
res
,
"Unexpected res %#lx.
\n
"
,
res
);
duration
=
IMFMediaEngineEx_GetDuration
(
media_engine
);
duration
=
IMFMediaEngineEx_GetDuration
(
media_engine
);
todo_wine
ok
(
compare_double
(
duration
,
0
.
133467
,
allowed_error
),
"Got unexpected duration %lf.
\n
"
,
duration
);
ok
(
compare_double
(
duration
,
0
.
133467
,
allowed_error
),
"Got unexpected duration %lf.
\n
"
,
duration
);
SysFreeString
(
url
);
SysFreeString
(
url
);
...
...
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