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
12c28aa2
Commit
12c28aa2
authored
Nov 23, 2022
by
Bernhard Kölbl
Committed by
Alexandre Julliard
Nov 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Pass volume changes to media session.
parent
edee5538
Show 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 @
12c28aa2
...
...
@@ -835,6 +835,23 @@ static void media_engine_get_frame_size(struct media_engine *engine, IMFTopology
IMFMediaType_Release
(
media_type
);
}
static
void
media_engine_apply_volume
(
const
struct
media_engine
*
engine
)
{
IMFSimpleAudioVolume
*
sa_volume
;
HRESULT
hr
;
if
(
!
engine
->
session
)
return
;
if
(
FAILED
(
MFGetService
((
IUnknown
*
)
engine
->
session
,
&
MR_POLICY_VOLUME_SERVICE
,
&
IID_IMFSimpleAudioVolume
,
(
void
**
)
&
sa_volume
)))
return
;
if
(
FAILED
(
hr
=
IMFSimpleAudioVolume_SetMasterVolume
(
sa_volume
,
engine
->
volume
)))
WARN
(
"Failed to set master volume, hr %#lx.
\n
"
,
hr
);
IMFSimpleAudioVolume_Release
(
sa_volume
);
}
static
HRESULT
WINAPI
media_engine_callback_QueryInterface
(
IMFAsyncCallback
*
iface
,
REFIID
riid
,
void
**
obj
)
{
if
(
IsEqualIID
(
riid
,
&
IID_IMFAsyncCallback
)
||
...
...
@@ -918,6 +935,8 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface
EnterCriticalSection
(
&
engine
->
cs
);
media_engine_apply_volume
(
engine
);
engine
->
ready_state
=
MF_MEDIA_ENGINE_READY_HAVE_METADATA
;
media_engine_get_frame_size
(
engine
,
topology
);
...
...
@@ -2009,6 +2028,7 @@ static HRESULT WINAPI media_engine_SetVolume(IMFMediaEngineEx *iface, double vol
else
if
(
volume
!=
engine
->
volume
)
{
engine
->
volume
=
volume
;
media_engine_apply_volume
(
engine
);
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_VOLUMECHANGE
,
0
,
0
);
}
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