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
ed0d100e
Commit
ed0d100e
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: Check for already opened stream in wm_reader_open*.
parent
35925856
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
+15
-20
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+0
-20
wm_reader.c
dlls/winegstreamer/wm_reader.c
+15
-0
No files found.
dlls/winegstreamer/wm_asyncreader.c
View file @
ed0d100e
...
...
@@ -393,21 +393,11 @@ static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
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
;
}
if
(
SUCCEEDED
(
hr
=
wm_reader_open_file
(
&
reader
->
reader
,
url
))
&&
FAILED
(
hr
=
async_reader_open
(
reader
,
callback
,
context
)))
wm_reader_close
(
&
reader
->
reader
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
...
...
@@ -873,21 +863,11 @@ 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
;
}
if
(
SUCCEEDED
(
hr
=
wm_reader_open_stream
(
&
reader
->
reader
,
stream
))
&&
FAILED
(
hr
=
async_reader_open
(
reader
,
callback
,
context
)))
wm_reader_close
(
&
reader
->
reader
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
...
...
dlls/winegstreamer/wm_reader.c
View file @
ed0d100e
...
...
@@ -1558,6 +1558,13 @@ HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream)
EnterCriticalSection
(
&
reader
->
cs
);
if
(
reader
->
wg_parser
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
WARN
(
"Stream is already open; returning E_UNEXPECTED.
\n
"
);
return
E_UNEXPECTED
;
}
IStream_AddRef
(
reader
->
source_stream
=
stream
);
if
(
FAILED
(
hr
=
init_stream
(
reader
,
stat
.
cbSize
.
QuadPart
)))
{
...
...
@@ -1591,6 +1598,14 @@ HRESULT wm_reader_open_file(struct wm_reader *reader, const WCHAR *filename)
EnterCriticalSection
(
&
reader
->
cs
);
if
(
reader
->
wg_parser
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
WARN
(
"Stream is already open; returning E_UNEXPECTED.
\n
"
);
CloseHandle
(
file
);
return
E_UNEXPECTED
;
}
reader
->
file
=
file
;
if
(
FAILED
(
hr
=
init_stream
(
reader
,
size
.
QuadPart
)))
...
...
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