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
bd86e934
Commit
bd86e934
authored
Oct 16, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/evr: Add per-stream lock.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bfeae85f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
evr.c
dlls/mf/evr.c
+24
-13
No files found.
dlls/mf/evr.c
View file @
bd86e934
...
...
@@ -47,6 +47,7 @@ struct video_stream
struct
video_renderer
*
parent
;
IMFMediaEventQueue
*
event_queue
;
IMFVideoSampleAllocator
*
allocator
;
CRITICAL_SECTION
cs
;
};
struct
video_renderer
...
...
@@ -213,6 +214,7 @@ static ULONG WINAPI video_stream_sink_Release(IMFStreamSink *iface)
IMFMediaEventQueue_Release
(
stream
->
event_queue
);
if
(
stream
->
allocator
)
IMFVideoSampleAllocator_Release
(
stream
->
allocator
);
DeleteCriticalSection
(
&
stream
->
cs
);
heap_free
(
stream
);
}
...
...
@@ -260,20 +262,23 @@ static HRESULT WINAPI video_stream_sink_QueueEvent(IMFStreamSink *iface, MediaEv
static
HRESULT
WINAPI
video_stream_sink_GetMediaSink
(
IMFStreamSink
*
iface
,
IMFMediaSink
**
sink
)
{
struct
video_stream
*
stream
=
impl_from_IMFStreamSink
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
sink
);
EnterCriticalSection
(
&
stream
->
cs
);
if
(
!
stream
->
parent
)
return
MF_E_STREAMSINK_REMOVED
;
if
(
!
sink
)
return
E_POINTER
;
/* FIXME: not entirely safe if sink is being shut down. */
*
sink
=
&
stream
->
parent
->
IMFMediaSink_iface
;
IMFMediaSink_AddRef
(
*
sink
);
hr
=
MF_E_STREAMSINK_REMOVED
;
else
if
(
!
sink
)
hr
=
E_POINTER
;
else
{
*
sink
=
&
stream
->
parent
->
IMFMediaSink_iface
;
IMFMediaSink_AddRef
(
*
sink
);
}
LeaveCriticalSection
(
&
stream
->
cs
);
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
video_stream_sink_GetIdentifier
(
IMFStreamSink
*
iface
,
DWORD
*
id
)
...
...
@@ -533,6 +538,7 @@ static HRESULT video_renderer_stream_create(struct video_renderer *renderer, uns
stream
->
IMFMediaTypeHandler_iface
.
lpVtbl
=
&
video_stream_type_handler_vtbl
;
stream
->
IMFGetService_iface
.
lpVtbl
=
&
video_stream_get_service_vtbl
;
stream
->
refcount
=
1
;
InitializeCriticalSection
(
&
stream
->
cs
);
if
(
FAILED
(
hr
=
MFCreateEventQueue
(
&
stream
->
event_queue
)))
goto
failed
;
...
...
@@ -894,10 +900,15 @@ static HRESULT WINAPI video_renderer_sink_Shutdown(IMFMediaSink *iface)
/* Detach streams from the sink. */
for
(
i
=
0
;
i
<
renderer
->
stream_count
;
++
i
)
{
IMFMediaSink_Release
(
&
renderer
->
streams
[
i
]
->
parent
->
IMFMediaSink_iface
);
renderer
->
streams
[
i
]
->
parent
=
NULL
;
IMFMediaEventQueue_Shutdown
(
renderer
->
streams
[
i
]
->
event_queue
);
IMFStreamSink_Release
(
&
renderer
->
streams
[
i
]
->
IMFStreamSink_iface
);
struct
video_stream
*
stream
=
renderer
->
streams
[
i
];
EnterCriticalSection
(
&
stream
->
cs
);
stream
->
parent
=
NULL
;
LeaveCriticalSection
(
&
stream
->
cs
);
IMFMediaEventQueue_Shutdown
(
stream
->
event_queue
);
IMFStreamSink_Release
(
&
stream
->
IMFStreamSink_iface
);
IMFMediaSink_Release
(
iface
);
renderer
->
streams
[
i
]
=
NULL
;
}
heap_free
(
renderer
->
streams
);
...
...
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