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
74b64eab
Commit
74b64eab
authored
Mar 09, 2023
by
Santino Mazza
Committed by
Alexandre Julliard
Apr 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/session: Handle errors when subscribing to source's events.
parent
2580799e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
session.c
dlls/mf/session.c
+11
-7
mf.c
dlls/mf/tests/mf.c
+2
-2
No files found.
dlls/mf/session.c
View file @
74b64eab
...
...
@@ -866,13 +866,13 @@ static void session_command_complete_with_event(struct media_session *session, M
session_command_complete
(
session
);
}
static
void
session_subscribe_sources
(
struct
media_session
*
session
)
static
HRESULT
session_subscribe_sources
(
struct
media_session
*
session
)
{
struct
media_source
*
source
;
HRESULT
hr
;
HRESULT
hr
=
S_OK
;
if
(
session
->
presentation
.
flags
&
SESSION_FLAG_SOURCES_SUBSCRIBED
)
return
;
return
hr
;
LIST_FOR_EACH_ENTRY
(
source
,
&
session
->
presentation
.
sources
,
struct
media_source
,
entry
)
{
...
...
@@ -880,10 +880,12 @@ static void session_subscribe_sources(struct media_session *session)
source
->
object
)))
{
WARN
(
"Failed to subscribe to source events, hr %#lx.
\n
"
,
hr
);
return
hr
;
}
}
session
->
presentation
.
flags
|=
SESSION_FLAG_SOURCES_SUBSCRIBED
;
return
hr
;
}
static
void
session_start
(
struct
media_session
*
session
,
const
GUID
*
time_format
,
const
PROPVARIANT
*
start_position
)
...
...
@@ -909,7 +911,11 @@ static void session_start(struct media_session *session, const GUID *time_format
session
->
presentation
.
start_position
.
vt
=
VT_EMPTY
;
PropVariantCopy
(
&
session
->
presentation
.
start_position
,
start_position
);
session_subscribe_sources
(
session
);
if
(
FAILED
(
hr
=
session_subscribe_sources
(
session
)))
{
session_command_complete_with_event
(
session
,
MESessionStarted
,
hr
,
NULL
);
return
;
}
LIST_FOR_EACH_ENTRY
(
source
,
&
session
->
presentation
.
sources
,
struct
media_source
,
entry
)
{
...
...
@@ -1308,10 +1314,8 @@ static void session_set_rate(struct media_session *session, BOOL thin, float rat
if
(
SUCCEEDED
(
hr
))
hr
=
IMFRateControl_GetRate
(
session
->
clock_rate_control
,
NULL
,
&
clock_rate
);
if
(
SUCCEEDED
(
hr
)
&&
(
rate
!=
clock_rate
))
if
(
SUCCEEDED
(
hr
)
&&
(
rate
!=
clock_rate
)
&&
SUCCEEDED
(
hr
=
session_subscribe_sources
(
session
))
)
{
session_subscribe_sources
(
session
);
LIST_FOR_EACH_ENTRY
(
source
,
&
session
->
presentation
.
sources
,
struct
media_source
,
entry
)
{
if
(
SUCCEEDED
(
hr
=
MFGetService
(
source
->
object
,
&
MF_RATE_CONTROL_SERVICE
,
&
IID_IMFRateControl
,
...
...
dlls/mf/tests/mf.c
View file @
74b64eab
...
...
@@ -2465,13 +2465,13 @@ static void test_media_session_events(void)
hr
=
IMFMediaSession_Start
(
session
,
&
GUID_NULL
,
&
propvar
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
wait_media_event_until_blocking
(
session
,
callback
,
MESessionStarted
,
1000
,
&
propvar
);
todo_wine
ok
(
hr
==
0x80001234
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
0x80001234
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
propvar
.
vt
==
VT_EMPTY
,
"got vt %u
\n
"
,
propvar
.
vt
);
ok
(
propvar
.
punkVal
!=
(
IUnknown
*
)
topology
,
"got punkVal %p
\n
"
,
propvar
.
punkVal
);
PropVariantClear
(
&
propvar
);
CHECK_CALLED
(
test_source_BeginGetEvent
);
todo_wine
{
CHECK_NOT_CALLED
(
test_source_Start
);
}
CHECK_NOT_CALLED
(
test_source_Start
);
hr
=
IMFMediaSession_ClearTopologies
(
session
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
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