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
1fab216a
Commit
1fab216a
authored
Sep 16, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use IWMSyncReader2_Close in the async reader.
parent
4a3f170c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
38 deletions
+32
-38
gst_private.h
dlls/winegstreamer/gst_private.h
+0
-1
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+4
-4
wm_reader.c
dlls/winegstreamer/wm_reader.c
+28
-33
No files found.
dlls/winegstreamer/gst_private.h
View file @
1fab216a
...
...
@@ -189,7 +189,6 @@ struct wm_reader
HRESULT
WINAPI
winegstreamer_create_wm_sync_reader
(
IUnknown
*
outer
,
void
**
out
);
struct
wm_reader
*
wm_reader_from_sync_reader_inner
(
IUnknown
*
inner
);
HRESULT
wm_reader_close
(
struct
wm_reader
*
reader
);
HRESULT
wm_reader_get_max_stream_size
(
struct
wm_reader
*
reader
,
WORD
stream_number
,
DWORD
*
size
);
HRESULT
wm_reader_get_output_format
(
struct
wm_reader
*
reader
,
DWORD
output
,
DWORD
index
,
IWMOutputMediaProps
**
props
);
...
...
dlls/winegstreamer/wm_asyncreader.c
View file @
1fab216a
...
...
@@ -443,7 +443,7 @@ static ULONG WINAPI WMReader_Release(IWMReader *iface)
reader
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
reader
->
cs
);
wm_reader_close
(
reader
->
wm_
reader
);
IWMSyncReader2_Close
(
reader
->
reader
);
IUnknown_Release
(
reader
->
reader_inner
);
free
(
reader
);
...
...
@@ -465,7 +465,7 @@ static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
if
(
SUCCEEDED
(
hr
=
wm_reader_open_file
(
reader
->
wm_reader
,
url
))
&&
FAILED
(
hr
=
async_reader_open
(
reader
,
callback
,
context
)))
wm_reader_close
(
reader
->
wm_
reader
);
IWMSyncReader2_Close
(
reader
->
reader
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
...
...
@@ -483,7 +483,7 @@ static HRESULT WINAPI WMReader_Close(IWMReader *iface)
if
(
SUCCEEDED
(
hr
=
async_reader_queue_op
(
reader
,
ASYNC_OP_CLOSE
,
NULL
)))
{
async_reader_close
(
reader
);
hr
=
wm_reader_close
(
reader
->
wm_
reader
);
hr
=
IWMSyncReader2_Close
(
reader
->
reader
);
}
LeaveCriticalSection
(
&
reader
->
cs
);
...
...
@@ -935,7 +935,7 @@ static HRESULT WINAPI WMReaderAdvanced2_OpenStream(IWMReaderAdvanced6 *iface,
if
(
SUCCEEDED
(
hr
=
wm_reader_open_stream
(
reader
->
wm_reader
,
stream
))
&&
FAILED
(
hr
=
async_reader_open
(
reader
,
callback
,
context
)))
wm_reader_close
(
reader
->
wm_
reader
);
IWMSyncReader2_Close
(
reader
->
reader
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
...
...
dlls/winegstreamer/wm_reader.c
View file @
1fab216a
...
...
@@ -1549,37 +1549,6 @@ HRESULT wm_reader_open_file(struct wm_reader *reader, const WCHAR *filename)
return
hr
;
}
HRESULT
wm_reader_close
(
struct
wm_reader
*
reader
)
{
EnterCriticalSection
(
&
reader
->
cs
);
if
(
!
reader
->
wg_parser
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
NS_E_INVALID_REQUEST
;
}
wg_parser_disconnect
(
reader
->
wg_parser
);
reader
->
read_thread_shutdown
=
true
;
WaitForSingleObject
(
reader
->
read_thread
,
INFINITE
);
CloseHandle
(
reader
->
read_thread
);
reader
->
read_thread
=
NULL
;
wg_parser_destroy
(
reader
->
wg_parser
);
reader
->
wg_parser
=
NULL
;
if
(
reader
->
source_stream
)
IStream_Release
(
reader
->
source_stream
);
reader
->
source_stream
=
NULL
;
if
(
reader
->
file
)
CloseHandle
(
reader
->
file
);
reader
->
file
=
NULL
;
LeaveCriticalSection
(
&
reader
->
cs
);
return
S_OK
;
}
static
struct
wm_stream
*
wm_reader_get_stream_by_stream_number
(
struct
wm_reader
*
reader
,
WORD
stream_number
)
{
if
(
stream_number
&&
stream_number
<=
reader
->
stream_count
)
...
...
@@ -2180,7 +2149,7 @@ static ULONG WINAPI unknown_inner_Release(IUnknown *iface)
if
(
!
refcount
)
{
wm_reader_close
(
reader
);
IWMSyncReader2_Close
(
&
reader
->
IWMSyncReader2_iface
);
reader
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
reader
->
cs
);
...
...
@@ -2227,7 +2196,33 @@ static HRESULT WINAPI reader_Close(IWMSyncReader2 *iface)
TRACE
(
"reader %p.
\n
"
,
reader
);
return
wm_reader_close
(
reader
);
EnterCriticalSection
(
&
reader
->
cs
);
if
(
!
reader
->
wg_parser
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
NS_E_INVALID_REQUEST
;
}
wg_parser_disconnect
(
reader
->
wg_parser
);
reader
->
read_thread_shutdown
=
true
;
WaitForSingleObject
(
reader
->
read_thread
,
INFINITE
);
CloseHandle
(
reader
->
read_thread
);
reader
->
read_thread
=
NULL
;
wg_parser_destroy
(
reader
->
wg_parser
);
reader
->
wg_parser
=
NULL
;
if
(
reader
->
source_stream
)
IStream_Release
(
reader
->
source_stream
);
reader
->
source_stream
=
NULL
;
if
(
reader
->
file
)
CloseHandle
(
reader
->
file
);
reader
->
file
=
NULL
;
LeaveCriticalSection
(
&
reader
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
reader_GetMaxOutputSampleSize
(
IWMSyncReader2
*
iface
,
DWORD
output
,
DWORD
*
max
)
...
...
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