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
5daa21f9
Commit
5daa21f9
authored
Aug 10, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Aug 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Implement media_engine_GetSeekable().
parent
4f0a7cd8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
main.c
dlls/mfmediaengine/main.c
+20
-2
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+0
-13
No files found.
dlls/mfmediaengine/main.c
View file @
5daa21f9
...
...
@@ -1899,17 +1899,35 @@ static HRESULT WINAPI media_engine_GetPlayed(IMFMediaEngineEx *iface, IMFMediaTi
static
HRESULT
WINAPI
media_engine_GetSeekable
(
IMFMediaEngineEx
*
iface
,
IMFMediaTimeRange
**
seekable
)
{
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
=
E_NOTIMPL
;
IMFMediaTimeRange
*
time_range
=
NULL
;
DWORD
flags
;
HRESULT
hr
;
FIXME
(
"(%p, %p): stub
.
\n
"
,
iface
,
seekable
);
TRACE
(
"%p, %p
.
\n
"
,
iface
,
seekable
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
{
hr
=
create_time_range
(
&
time_range
);
if
(
SUCCEEDED
(
hr
)
&&
!
isnan
(
engine
->
duration
)
&&
engine
->
presentation
.
source
)
{
hr
=
IMFMediaSource_GetCharacteristics
(
engine
->
presentation
.
source
,
&
flags
);
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
MFBYTESTREAM_IS_SEEKABLE
))
hr
=
IMFMediaTimeRange_AddRange
(
time_range
,
0
.
0
,
engine
->
duration
);
}
}
LeaveCriticalSection
(
&
engine
->
cs
);
if
(
FAILED
(
hr
)
&&
time_range
)
{
IMFMediaTimeRange_Release
(
time_range
);
time_range
=
NULL
;
}
*
seekable
=
time_range
;
return
hr
;
}
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
5daa21f9
...
...
@@ -2285,15 +2285,11 @@ static void test_GetSeekable(void)
/* Media engine is not ready */
hr
=
IMFMediaEngineEx_GetSeekable
(
media_engine
,
&
time_range
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
count
=
IMFMediaTimeRange_GetLength
(
time_range
);
ok
(
!
count
,
"Unexpected count %lu.
\n
"
,
count
);
refcount
=
IMFMediaTimeRange_Release
(
time_range
);
ok
(
!
refcount
,
"Got unexpected refcount %lu.
\n
"
,
refcount
);
}
hr
=
IMFMediaEngineEx_Play
(
media_engine
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
@@ -2307,10 +2303,7 @@ static void test_GetSeekable(void)
/* Media engine is ready */
hr
=
IMFMediaEngineEx_GetSeekable
(
media_engine
,
&
time_range
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
count
=
IMFMediaTimeRange_GetLength
(
time_range
);
ok
(
count
==
1
,
"Unexpected count %lu.
\n
"
,
count
);
hr
=
IMFMediaTimeRange_GetStart
(
time_range
,
0
,
&
start
);
...
...
@@ -2322,7 +2315,6 @@ static void test_GetSeekable(void)
ok
(
end
==
duration
,
"Unexpected end %lf.
\n
"
,
end
);
refcount
=
IMFMediaTimeRange_Release
(
time_range
);
ok
(
!
refcount
,
"Got unexpected refcount %lu.
\n
"
,
refcount
);
}
/* Media engine is shut down */
hr
=
IMFMediaEngineEx_Shutdown
(
media_engine
);
...
...
@@ -2331,7 +2323,6 @@ static void test_GetSeekable(void)
time_range
=
(
IMFMediaTimeRange
*
)
0xdeadbeef
;
hr
=
IMFMediaEngineEx_GetSeekable
(
media_engine
,
&
time_range
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
time_range
==
NULL
||
broken
(
time_range
==
(
IMFMediaTimeRange
*
)
0xdeadbeef
)
/* <= Win10 1507 */
,
"Got unexpected pointer.
\n
"
);
...
...
@@ -2357,15 +2348,11 @@ static void test_GetSeekable(void)
ok
(
res
==
S_OK
,
"Unexpected res %#lx.
\n
"
,
res
);
hr
=
IMFMediaEngineEx_GetSeekable
(
media_engine
,
&
time_range
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
count
=
IMFMediaTimeRange_GetLength
(
time_range
);
ok
(
!
count
,
"Unexpected count %lu.
\n
"
,
count
);
refcount
=
IMFMediaTimeRange_Release
(
time_range
);
ok
(
!
refcount
,
"Got unexpected refcount %lu.
\n
"
,
refcount
);
}
done:
hr
=
IMFMediaEngineEx_Shutdown
(
media_engine
);
...
...
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