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
49af378e
Commit
49af378e
authored
Apr 27, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
May 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Synchronize concurrent access to the media stream.
parent
aed8612c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
22 deletions
+33
-22
media_source.c
dlls/winegstreamer/media_source.c
+33
-22
No files found.
dlls/winegstreamer/media_source.c
View file @
49af378e
...
...
@@ -750,31 +750,46 @@ static HRESULT WINAPI media_stream_GetMediaSource(IMFMediaStream *iface, IMFMedi
{
struct
media_stream
*
stream
=
impl_from_IMFMediaStream
(
iface
);
struct
media_source
*
source
=
impl_from_IMFMediaSource
(
stream
->
media_source
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
out
);
EnterCriticalSection
(
&
source
->
cs
);
if
(
stream
->
state
==
STREAM_SHUTDOWN
)
return
MF_E_SHUTDOWN
;
hr
=
MF_E_SHUTDOWN
;
else
{
IMFMediaSource_AddRef
(
&
source
->
IMFMediaSource_iface
);
*
out
=
&
source
->
IMFMediaSource_iface
;
}
IMFMediaSource_AddRef
(
&
source
->
IMFMediaSource_iface
);
*
out
=
&
source
->
IMFMediaSource_iface
;
LeaveCriticalSection
(
&
source
->
cs
);
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
media_stream_GetStreamDescriptor
(
IMFMediaStream
*
iface
,
IMFStreamDescriptor
**
descriptor
)
{
struct
media_stream
*
stream
=
impl_from_IMFMediaStream
(
iface
);
struct
media_source
*
source
=
impl_from_IMFMediaSource
(
stream
->
media_source
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
descriptor
);
EnterCriticalSection
(
&
source
->
cs
);
if
(
stream
->
state
==
STREAM_SHUTDOWN
)
return
MF_E_SHUTDOWN
;
hr
=
MF_E_SHUTDOWN
;
else
{
IMFStreamDescriptor_AddRef
(
stream
->
descriptor
);
*
descriptor
=
stream
->
descriptor
;
}
IMFStreamDescriptor_AddRef
(
stream
->
descriptor
);
*
descriptor
=
stream
->
descriptor
;
LeaveCriticalSection
(
&
source
->
cs
);
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
media_stream_RequestSample
(
IMFMediaStream
*
iface
,
IUnknown
*
token
)
...
...
@@ -786,21 +801,15 @@ static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown
TRACE
(
"%p, %p.
\n
"
,
iface
,
token
);
if
(
stream
->
state
==
STREAM_SHUTDOWN
)
return
MF_E_SHUTDOWN
;
if
(
stream
->
state
==
STREAM_INACTIVE
)
{
WARN
(
"Stream isn't active
\n
"
);
return
MF_E_MEDIA_SOURCE_WRONGSTATE
;
}
if
(
stream
->
eos
)
{
return
MF_E_END_OF_STREAM
;
}
EnterCriticalSection
(
&
source
->
cs
);
if
(
SUCCEEDED
(
hr
=
source_create_async_op
(
SOURCE_ASYNC_REQUEST_SAMPLE
,
&
command
)))
if
(
stream
->
state
==
STREAM_SHUTDOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
stream
->
state
==
STREAM_INACTIVE
)
hr
=
MF_E_MEDIA_SOURCE_WRONGSTATE
;
else
if
(
stream
->
eos
)
hr
=
MF_E_END_OF_STREAM
;
else
if
(
SUCCEEDED
(
hr
=
source_create_async_op
(
SOURCE_ASYNC_REQUEST_SAMPLE
,
&
command
)))
{
command
->
u
.
request_sample
.
stream
=
stream
;
if
(
token
)
...
...
@@ -810,6 +819,8 @@ static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown
hr
=
MFPutWorkItem
(
source
->
async_commands_queue
,
&
source
->
async_commands_callback
,
&
command
->
IUnknown_iface
);
}
LeaveCriticalSection
(
&
source
->
cs
);
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