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
35925856
Commit
35925856
authored
Aug 22, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use a dedicated CS to serialize async reader commands.
parent
daf10989
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+18
-6
No files found.
dlls/winegstreamer/wm_asyncreader.c
View file @
35925856
...
...
@@ -64,6 +64,8 @@ struct async_reader
IWMReaderTypeNegotiation
IWMReaderTypeNegotiation_iface
;
IReferenceClock
IReferenceClock_iface
;
CRITICAL_SECTION
cs
;
IWMReaderCallbackAdvanced
*
callback_advanced
;
IWMReaderCallback
*
callback
;
void
*
context
;
...
...
@@ -390,11 +392,13 @@ static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
TRACE
(
"reader %p, url %s, callback %p, context %p.
\n
"
,
reader
,
debugstr_w
(
url
),
callback
,
context
);
EnterCriticalSection
(
&
reader
->
cs
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
if
(
reader
->
reader
.
wg_parser
)
{
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
WARN
(
"Stream is already open; returning E_UNEXPECTED.
\n
"
);
return
E_UNEXPECTED
;
}
...
...
@@ -404,6 +408,7 @@ static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
wm_reader_close
(
&
reader
->
reader
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
...
...
@@ -414,7 +419,7 @@ static HRESULT WINAPI WMReader_Close(IWMReader *iface)
TRACE
(
"reader %p.
\n
"
,
reader
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
EnterCriticalSection
(
&
reader
->
cs
);
if
(
SUCCEEDED
(
hr
=
async_reader_queue_op
(
reader
,
ASYNC_OP_CLOSE
,
NULL
)))
{
...
...
@@ -422,7 +427,7 @@ static HRESULT WINAPI WMReader_Close(IWMReader *iface)
hr
=
wm_reader_close
(
&
reader
->
reader
);
}
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
...
...
@@ -489,14 +494,14 @@ static HRESULT WINAPI WMReader_Start(IWMReader *iface,
if
(
rate
!=
1
.
0
f
)
FIXME
(
"Ignoring rate %.8e.
\n
"
,
rate
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
EnterCriticalSection
(
&
reader
->
cs
);
if
(
!
reader
->
callback_thread
)
hr
=
NS_E_INVALID_REQUEST
;
else
hr
=
async_reader_queue_op
(
reader
,
ASYNC_OP_START
,
&
data
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
...
...
@@ -508,14 +513,14 @@ static HRESULT WINAPI WMReader_Stop(IWMReader *iface)
TRACE
(
"reader %p.
\n
"
,
reader
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
EnterCriticalSection
(
&
reader
->
cs
);
if
(
!
reader
->
callback_thread
)
hr
=
E_UNEXPECTED
;
else
hr
=
async_reader_queue_op
(
reader
,
ASYNC_OP_STOP
,
NULL
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
...
...
@@ -867,11 +872,13 @@ static HRESULT WINAPI WMReaderAdvanced2_OpenStream(IWMReaderAdvanced6 *iface,
TRACE
(
"reader %p, stream %p, callback %p, context %p.
\n
"
,
reader
,
stream
,
callback
,
context
);
EnterCriticalSection
(
&
reader
->
cs
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
if
(
reader
->
reader
.
wg_parser
)
{
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
WARN
(
"Stream is already open; returning E_UNEXPECTED.
\n
"
);
return
E_UNEXPECTED
;
}
...
...
@@ -881,6 +888,7 @@ static HRESULT WINAPI WMReaderAdvanced2_OpenStream(IWMReaderAdvanced6 *iface,
wm_reader_close
(
&
reader
->
reader
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
...
...
@@ -1742,6 +1750,8 @@ static void async_reader_destroy(struct wm_reader *iface)
reader
->
callback_cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
reader
->
callback_cs
);
reader
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
reader
->
cs
);
wm_reader_close
(
&
reader
->
reader
);
...
...
@@ -1774,6 +1784,8 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader)
object
->
IWMReaderStreamClock_iface
.
lpVtbl
=
&
WMReaderStreamClockVtbl
;
object
->
IWMReaderTypeNegotiation_iface
.
lpVtbl
=
&
WMReaderTypeNegotiationVtbl
;
InitializeCriticalSection
(
&
object
->
cs
);
object
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": async_reader.cs"
);
InitializeCriticalSection
(
&
object
->
callback_cs
);
object
->
callback_cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": async_reader.callback_cs"
);
...
...
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