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
04a26628
Commit
04a26628
authored
Jun 23, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/session: Fix pause command handling from invalid states.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cba7616d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
session.c
dlls/mf/session.c
+14
-5
No files found.
dlls/mf/session.c
View file @
04a26628
...
...
@@ -903,9 +903,12 @@ static void session_set_started(struct media_session *session)
session_command_complete
(
session
);
}
static
void
session_set_paused
(
struct
media_session
*
session
,
HRESULT
status
)
static
void
session_set_paused
(
struct
media_session
*
session
,
unsigned
int
state
,
HRESULT
status
)
{
session
->
state
=
SESSION_STATE_PAUSED
;
/* Failed event status could indicate a failure during normal transition to paused state,
or an attempt to pause from invalid initial state. To finalize failed transition in the former case,
state is still forced to PAUSED, otherwise previous state is retained. */
if
(
state
!=
~
0u
)
session
->
state
=
state
;
if
(
SUCCEEDED
(
status
))
session_set_caps
(
session
,
session
->
caps
&
~
MFSESSIONCAP_PAUSE
);
IMFMediaEventQueue_QueueEventParamVar
(
session
->
event_queue
,
MESessionPaused
,
&
GUID_NULL
,
status
,
NULL
);
...
...
@@ -923,6 +926,7 @@ static void session_set_closed(struct media_session *session, HRESULT status)
static
void
session_pause
(
struct
media_session
*
session
)
{
unsigned
int
state
=
~
0u
;
HRESULT
hr
;
switch
(
session
->
state
)
...
...
@@ -932,14 +936,19 @@ static void session_pause(struct media_session *session)
/* Transition in two steps - pause the clock, wait for sinks, then pause sources. */
if
(
SUCCEEDED
(
hr
=
IMFPresentationClock_Pause
(
session
->
clock
)))
session
->
state
=
SESSION_STATE_PAUSING_SINKS
;
state
=
SESSION_STATE_PAUSED
;
break
;
case
SESSION_STATE_STOPPED
:
hr
=
MF_E_SESSION_PAUSEWHILESTOPPED
;
break
;
default:
hr
=
MF_E_INVALIDREQUEST
;
}
if
(
FAILED
(
hr
))
session_set_paused
(
session
,
hr
);
session_set_paused
(
session
,
state
,
hr
);
}
static
void
session_clear_end_of_presentation
(
struct
media_session
*
session
)
...
...
@@ -2502,7 +2511,7 @@ static void session_set_source_object_state(struct media_session *session, IUnkn
if
(
!
session_is_source_nodes_state
(
session
,
OBJ_STATE_PAUSED
))
break
;
session_set_paused
(
session
,
S_OK
);
session_set_paused
(
session
,
S
ESSION_STATE_PAUSED
,
S
_OK
);
break
;
case
SESSION_STATE_STOPPING_SOURCES
:
if
(
!
session_is_source_nodes_state
(
session
,
OBJ_STATE_STOPPED
))
...
...
@@ -2578,7 +2587,7 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre
}
if
(
FAILED
(
hr
))
session_set_paused
(
session
,
hr
);
session_set_paused
(
session
,
SESSION_STATE_PAUSED
,
hr
);
break
;
case
SESSION_STATE_STOPPING_SINKS
:
...
...
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