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
9a7d166e
Commit
9a7d166e
authored
Feb 18, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Shutdown media source when clearing current presentation.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5a66eab7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
main.c
dlls/mfmediaengine/main.c
+20
-0
No files found.
dlls/mfmediaengine/main.c
View file @
9a7d166e
...
...
@@ -142,6 +142,10 @@ struct media_engine
BSTR
current_source
;
struct
{
IMFMediaSource
*
source
;
}
presentation
;
struct
{
LONGLONG
pts
;
SIZE
size
;
SIZE
ratio
;
...
...
@@ -1071,6 +1075,16 @@ static HRESULT media_engine_create_video_renderer(struct media_engine *engine, I
return
hr
;
}
static
void
media_engine_clear_presentation
(
struct
media_engine
*
engine
)
{
if
(
engine
->
presentation
.
source
)
{
IMFMediaSource_Shutdown
(
engine
->
presentation
.
source
);
IMFMediaSource_Release
(
engine
->
presentation
.
source
);
}
memset
(
&
engine
->
presentation
,
0
,
sizeof
(
engine
->
presentation
));
}
static
HRESULT
media_engine_create_topology
(
struct
media_engine
*
engine
,
IMFMediaSource
*
source
)
{
IMFStreamDescriptor
*
sd_audio
=
NULL
,
*
sd_video
=
NULL
;
...
...
@@ -1081,6 +1095,7 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
HRESULT
hr
;
media_engine_release_video_frame_resources
(
engine
);
media_engine_clear_presentation
(
engine
);
if
(
FAILED
(
hr
=
IMFMediaSource_CreatePresentationDescriptor
(
source
,
&
pd
)))
return
hr
;
...
...
@@ -1134,6 +1149,9 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
return
E_UNEXPECTED
;
}
engine
->
presentation
.
source
=
source
;
IMFMediaSource_AddRef
(
engine
->
presentation
.
source
);
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_HAS_VIDEO
,
!!
sd_video
);
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_HAS_AUDIO
,
!!
sd_audio
);
...
...
@@ -1340,6 +1358,7 @@ static void free_media_engine(struct media_engine *engine)
if
(
engine
->
resolver
)
IMFSourceResolver_Release
(
engine
->
resolver
);
media_engine_release_video_frame_resources
(
engine
);
media_engine_clear_presentation
(
engine
);
if
(
engine
->
device_manager
)
{
IMFDXGIDeviceManager_CloseDeviceHandle
(
engine
->
device_manager
,
engine
->
device_handle
);
...
...
@@ -2086,6 +2105,7 @@ static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngineEx *iface)
else
{
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_SHUT_DOWN
,
TRUE
);
media_engine_clear_presentation
(
engine
);
IMFMediaSession_Shutdown
(
engine
->
session
);
}
LeaveCriticalSection
(
&
engine
->
cs
);
...
...
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