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
1b527e8c
Commit
1b527e8c
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_Open in the async reader.
parent
1fab216a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
42 deletions
+35
-42
gst_private.h
dlls/winegstreamer/gst_private.h
+0
-1
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+1
-1
wm_reader.c
dlls/winegstreamer/wm_reader.c
+34
-40
No files found.
dlls/winegstreamer/gst_private.h
View file @
1b527e8c
...
...
@@ -199,7 +199,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA
INSSBuffer
**
ret_sample
,
QWORD
*
pts
,
QWORD
*
duration
,
DWORD
*
flags
,
WORD
*
ret_stream_number
);
HRESULT
wm_reader_get_stream_selection
(
struct
wm_reader
*
reader
,
WORD
stream_number
,
WMT_STREAM_SELECTION
*
selection
);
HRESULT
wm_reader_open_file
(
struct
wm_reader
*
reader
,
const
WCHAR
*
filename
);
HRESULT
wm_reader_open_stream
(
struct
wm_reader
*
reader
,
IStream
*
stream
);
void
wm_reader_seek
(
struct
wm_reader
*
reader
,
QWORD
start
,
LONGLONG
duration
);
HRESULT
wm_reader_set_allocate_for_output
(
struct
wm_reader
*
reader
,
DWORD
output
,
BOOL
allocate
);
...
...
dlls/winegstreamer/wm_asyncreader.c
View file @
1b527e8c
...
...
@@ -463,7 +463,7 @@ static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
EnterCriticalSection
(
&
reader
->
cs
);
if
(
SUCCEEDED
(
hr
=
wm_reader_open_file
(
reader
->
wm_
reader
,
url
))
if
(
SUCCEEDED
(
hr
=
IWMSyncReader2_Open
(
reader
->
reader
,
url
))
&&
FAILED
(
hr
=
async_reader_open
(
reader
,
callback
,
context
)))
IWMSyncReader2_Close
(
reader
->
reader
);
...
...
dlls/winegstreamer/wm_reader.c
View file @
1b527e8c
...
...
@@ -1510,45 +1510,6 @@ HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream)
return
hr
;
}
HRESULT
wm_reader_open_file
(
struct
wm_reader
*
reader
,
const
WCHAR
*
filename
)
{
LARGE_INTEGER
size
;
HANDLE
file
;
HRESULT
hr
;
if
((
file
=
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
))
==
INVALID_HANDLE_VALUE
)
{
ERR
(
"Failed to open %s, error %lu.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
if
(
!
GetFileSizeEx
(
file
,
&
size
))
{
ERR
(
"Failed to get the size of %s, error %lu.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
CloseHandle
(
file
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
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
)))
reader
->
file
=
NULL
;
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
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
)
...
...
@@ -2370,10 +2331,43 @@ static HRESULT WINAPI reader_GetStreamSelected(IWMSyncReader2 *iface,
static
HRESULT
WINAPI
reader_Open
(
IWMSyncReader2
*
iface
,
const
WCHAR
*
filename
)
{
struct
wm_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
LARGE_INTEGER
size
;
HANDLE
file
;
HRESULT
hr
;
TRACE
(
"reader %p, filename %s.
\n
"
,
reader
,
debugstr_w
(
filename
));
return
wm_reader_open_file
(
reader
,
filename
);
if
((
file
=
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
))
==
INVALID_HANDLE_VALUE
)
{
ERR
(
"Failed to open %s, error %lu.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
if
(
!
GetFileSizeEx
(
file
,
&
size
))
{
ERR
(
"Failed to get the size of %s, error %lu.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
CloseHandle
(
file
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
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
)))
reader
->
file
=
NULL
;
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
reader_OpenStream
(
IWMSyncReader2
*
iface
,
IStream
*
stream
)
...
...
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