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
3e4f4c02
Commit
3e4f4c02
authored
Feb 16, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplay: Shutdown sources when media items are released.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
decfb2b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
player.c
dlls/mfplay/player.c
+16
-2
No files found.
dlls/mfplay/player.c
View file @
3e4f4c02
...
@@ -61,6 +61,11 @@ static inline const char *debugstr_normalized_rect(const MFVideoNormalizedRect *
...
@@ -61,6 +61,11 @@ static inline const char *debugstr_normalized_rect(const MFVideoNormalizedRect *
struct
media_player
;
struct
media_player
;
enum
media_item_flags
{
MEDIA_ITEM_SOURCE_NEEDS_SHUTDOWN
=
0x1
,
};
struct
media_item
struct
media_item
{
{
IMFPMediaItem
IMFPMediaItem_iface
;
IMFPMediaItem
IMFPMediaItem_iface
;
...
@@ -73,6 +78,7 @@ struct media_item
...
@@ -73,6 +78,7 @@ struct media_item
IUnknown
*
object
;
IUnknown
*
object
;
LONGLONG
start_position
;
LONGLONG
start_position
;
LONGLONG
stop_position
;
LONGLONG
stop_position
;
unsigned
int
flags
;
};
};
struct
media_player
struct
media_player
...
@@ -359,7 +365,11 @@ static ULONG WINAPI media_item_Release(IMFPMediaItem *iface)
...
@@ -359,7 +365,11 @@ static ULONG WINAPI media_item_Release(IMFPMediaItem *iface)
if
(
item
->
player
)
if
(
item
->
player
)
IMFPMediaPlayer_Release
(
&
item
->
player
->
IMFPMediaPlayer_iface
);
IMFPMediaPlayer_Release
(
&
item
->
player
->
IMFPMediaPlayer_iface
);
if
(
item
->
source
)
if
(
item
->
source
)
{
if
(
item
->
flags
&
MEDIA_ITEM_SOURCE_NEEDS_SHUTDOWN
)
IMFMediaSource_Shutdown
(
item
->
source
);
IMFMediaSource_Release
(
item
->
source
);
IMFMediaSource_Release
(
item
->
source
);
}
if
(
item
->
pd
)
if
(
item
->
pd
)
IMFPresentationDescriptor_Release
(
item
->
pd
);
IMFPresentationDescriptor_Release
(
item
->
pd
);
if
(
item
->
object
)
if
(
item
->
object
)
...
@@ -1189,6 +1199,7 @@ static HRESULT media_player_create_item_from_url(struct media_player *player,
...
@@ -1189,6 +1199,7 @@ static HRESULT media_player_create_item_from_url(struct media_player *player,
IMFPMediaItem_Release
(
&
item
->
IMFPMediaItem_iface
);
IMFPMediaItem_Release
(
&
item
->
IMFPMediaItem_iface
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
item
->
flags
|=
MEDIA_ITEM_SOURCE_NEEDS_SHUTDOWN
;
if
(
sync
)
if
(
sync
)
{
{
...
@@ -1244,11 +1255,11 @@ static HRESULT WINAPI media_player_CreateMediaItemFromURL(IMFPMediaPlayer *iface
...
@@ -1244,11 +1255,11 @@ static HRESULT WINAPI media_player_CreateMediaItemFromURL(IMFPMediaPlayer *iface
static
HRESULT
media_player_create_item_from_object
(
struct
media_player
*
player
,
static
HRESULT
media_player_create_item_from_object
(
struct
media_player
*
player
,
IUnknown
*
object
,
BOOL
sync
,
DWORD_PTR
user_data
,
IMFPMediaItem
**
ret
)
IUnknown
*
object
,
BOOL
sync
,
DWORD_PTR
user_data
,
IMFPMediaItem
**
ret
)
{
{
IMFMediaSource
*
source
=
NULL
;
IMFByteStream
*
stream
=
NULL
;
struct
media_item
*
item
;
struct
media_item
*
item
;
MF_OBJECT_TYPE
obj_type
;
MF_OBJECT_TYPE
obj_type
;
HRESULT
hr
;
HRESULT
hr
;
IMFByteStream
*
stream
=
NULL
;
IMFMediaSource
*
source
=
NULL
;
*
ret
=
NULL
;
*
ret
=
NULL
;
...
@@ -1268,6 +1279,9 @@ static HRESULT media_player_create_item_from_object(struct media_player *player,
...
@@ -1268,6 +1279,9 @@ static HRESULT media_player_create_item_from_object(struct media_player *player,
return
E_UNEXPECTED
;
return
E_UNEXPECTED
;
}
}
if
(
source
)
item
->
flags
|=
MEDIA_ITEM_SOURCE_NEEDS_SHUTDOWN
;
if
(
sync
)
if
(
sync
)
{
{
if
(
stream
)
if
(
stream
)
...
...
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