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
2efb464b
Commit
2efb464b
authored
Apr 05, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplay: Automatically initialize Media Foundation.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
97ed08cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
Makefile.in
dlls/mfplay/Makefile.in
+1
-1
player.c
dlls/mfplay/player.c
+19
-0
No files found.
dlls/mfplay/Makefile.in
View file @
2efb464b
MODULE
=
mfplay.dll
IMPORTLIB
=
mfplay
IMPORTS
=
uuid mfuuid
IMPORTS
=
mfplat
uuid mfuuid
EXTRADLLFLAGS
=
-mno-cygwin
-Wb
,--prefer-native
...
...
dlls/mfplay/player.c
View file @
2efb464b
...
...
@@ -22,6 +22,7 @@
#include "windef.h"
#include "winbase.h"
#include "mfapi.h"
#include "mfplay.h"
#include "wine/debug.h"
...
...
@@ -29,6 +30,20 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
static
LONG
startup_refcount
;
static
void
platform_startup
(
void
)
{
if
(
InterlockedIncrement
(
&
startup_refcount
)
==
1
)
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
}
static
void
platform_shutdown
(
void
)
{
if
(
InterlockedDecrement
(
&
startup_refcount
)
==
0
)
MFShutdown
();
}
struct
media_player
{
IMFPMediaPlayer
IMFPMediaPlayer_iface
;
...
...
@@ -81,6 +96,8 @@ static ULONG WINAPI media_player_Release(IMFPMediaPlayer *iface)
if
(
player
->
callback
)
IMFPMediaPlayerCallback_Release
(
player
->
callback
);
heap_free
(
player
);
platform_shutdown
();
}
return
refcount
;
...
...
@@ -405,6 +422,8 @@ HRESULT WINAPI MFPCreateMediaPlayer(const WCHAR *url, BOOL start_playback, MFP_C
if
(
object
->
callback
)
IMFPMediaPlayerCallback_AddRef
(
object
->
callback
);
platform_startup
();
*
player
=
&
object
->
IMFPMediaPlayer_iface
;
return
S_OK
;
...
...
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