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
ec097bc1
Commit
ec097bc1
authored
Jul 04, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/samplegrabber: Consistently check for shutdown flag within a lock.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
568b4bc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
25 deletions
+23
-25
samplegrabber.c
dlls/mf/samplegrabber.c
+23
-25
No files found.
dlls/mf/samplegrabber.c
View file @
ec097bc1
...
@@ -507,32 +507,29 @@ static HRESULT WINAPI sample_grabber_stream_Flush(IMFStreamSink *iface)
...
@@ -507,32 +507,29 @@ static HRESULT WINAPI sample_grabber_stream_Flush(IMFStreamSink *iface)
{
{
struct
sample_grabber
*
grabber
=
impl_from_IMFStreamSink
(
iface
);
struct
sample_grabber
*
grabber
=
impl_from_IMFStreamSink
(
iface
);
struct
scheduled_item
*
item
,
*
next_item
;
struct
scheduled_item
*
item
,
*
next_item
;
HRESULT
hr
=
S_OK
;
TRACE
(
"%p.
\n
"
,
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
if
(
grabber
->
is_shut_down
)
return
MF_E_STREAMSINK_REMOVED
;
EnterCriticalSection
(
&
grabber
->
cs
);
EnterCriticalSection
(
&
grabber
->
cs
);
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
next_item
,
&
grabber
->
items
,
struct
scheduled_item
,
entry
)
if
(
grabber
->
is_shut_down
)
hr
=
MF_E_STREAMSINK_REMOVED
;
else
{
{
/* Samples are discarded, markers are processed immediately. */
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
next_item
,
&
grabber
->
items
,
struct
scheduled_item
,
entry
)
switch
(
item
->
type
)
{
{
case
ITEM_TYPE_SAMPLE
:
/* Samples are discarded, markers are processed immediately. */
break
;
if
(
item
->
type
==
ITEM_TYPE_MARKER
)
case
ITEM_TYPE_MARKER
:
sample_grabber_stream_report_marker
(
grabber
,
&
item
->
u
.
marker
.
context
,
E_ABORT
);
sample_grabber_stream_report_marker
(
grabber
,
&
item
->
u
.
marker
.
context
,
E_ABORT
);
break
;
}
stream_release_pending_item
(
item
);
stream_release_pending_item
(
item
);
}
}
}
LeaveCriticalSection
(
&
grabber
->
cs
);
LeaveCriticalSection
(
&
grabber
->
cs
);
return
S_OK
;
return
hr
;
}
}
static
const
IMFStreamSinkVtbl
sample_grabber_stream_vtbl
=
static
const
IMFStreamSinkVtbl
sample_grabber_stream_vtbl
=
...
@@ -924,9 +921,6 @@ static HRESULT WINAPI sample_grabber_sink_GetStreamSinkByIndex(IMFMediaSink *ifa
...
@@ -924,9 +921,6 @@ static HRESULT WINAPI sample_grabber_sink_GetStreamSinkByIndex(IMFMediaSink *ifa
TRACE
(
"%p, %lu, %p.
\n
"
,
iface
,
index
,
stream
);
TRACE
(
"%p, %lu, %p.
\n
"
,
iface
,
index
,
stream
);
if
(
grabber
->
is_shut_down
)
return
MF_E_SHUTDOWN
;
EnterCriticalSection
(
&
grabber
->
cs
);
EnterCriticalSection
(
&
grabber
->
cs
);
if
(
grabber
->
is_shut_down
)
if
(
grabber
->
is_shut_down
)
...
@@ -1057,18 +1051,22 @@ static HRESULT WINAPI sample_grabber_sink_Shutdown(IMFMediaSink *iface)
...
@@ -1057,18 +1051,22 @@ static HRESULT WINAPI sample_grabber_sink_Shutdown(IMFMediaSink *iface)
TRACE
(
"%p.
\n
"
,
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
if
(
grabber
->
is_shut_down
)
return
MF_E_SHUTDOWN
;
EnterCriticalSection
(
&
grabber
->
cs
);
EnterCriticalSection
(
&
grabber
->
cs
);
grabber
->
is_shut_down
=
TRUE
;
sample_grabber_release_pending_items
(
grabber
);
if
(
grabber
->
is_shut_down
)
if
(
SUCCEEDED
(
hr
=
IMFSampleGrabberSinkCallback_OnShutdown
(
sample_grabber_get_callback
(
grabber
))))
hr
=
MF_E_SHUTDOWN
;
else
{
{
sample_grabber_set_presentation_clock
(
grabber
,
NULL
);
grabber
->
is_shut_down
=
TRUE
;
IMFMediaEventQueue_Shutdown
(
grabber
->
stream_event_queue
);
sample_grabber_release_pending_items
(
grabber
);
IMFMediaEventQueue_Shutdown
(
grabber
->
event_queue
);
if
(
SUCCEEDED
(
hr
=
IMFSampleGrabberSinkCallback_OnShutdown
(
sample_grabber_get_callback
(
grabber
))))
{
sample_grabber_set_presentation_clock
(
grabber
,
NULL
);
IMFMediaEventQueue_Shutdown
(
grabber
->
stream_event_queue
);
IMFMediaEventQueue_Shutdown
(
grabber
->
event_queue
);
}
}
}
LeaveCriticalSection
(
&
grabber
->
cs
);
LeaveCriticalSection
(
&
grabber
->
cs
);
return
hr
;
return
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